From 0e025786c8207bd39064890a0c97023256f3171d Mon Sep 17 00:00:00 2001 From: "sail@chromium.org" Date: Tue, 18 Oct 2011 01:28:46 +0000 Subject: Prevent invalid file error when restoring session BUG=99371 TEST= Review URL: http://codereview.chromium.org/8312007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105992 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/sessions/session_backend.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/browser/sessions/session_backend.cc b/chrome/browser/sessions/session_backend.cc index a29719b..8f92e9b 100644 --- a/chrome/browser/sessions/session_backend.cc +++ b/chrome/browser/sessions/session_backend.cc @@ -46,7 +46,8 @@ class SessionFileReader { buffer_position_(0), available_count_(0) { file_.reset(new net::FileStream()); - file_->Open(path, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ); + if (file_util::PathExists(path)) + file_->Open(path, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ); } // Reads the contents of the file specified in the constructor, returning // true on success. It is up to the caller to free all SessionCommands -- cgit v1.1