summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-09 18:41:46 +0000
committertbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-09 18:41:46 +0000
commit0cd49c61342eb2beb29f79e8a4d8fb44aa72fbff (patch)
tree21fdc5dfde584082c0388b6f385536b1a8c05399 /chrome
parentb5e0ece46b3b4f30451b2da39960220275be20ca (diff)
downloadchromium_src-0cd49c61342eb2beb29f79e8a4d8fb44aa72fbff.zip
chromium_src-0cd49c61342eb2beb29f79e8a4d8fb44aa72fbff.tar.gz
chromium_src-0cd49c61342eb2beb29f79e8a4d8fb44aa72fbff.tar.bz2
Handle error in GDataFileSystemProxy::ReadDirectory correctly.
If error occured during reading directory, |file| in OnReadDirectory will be NULL, so we have to hadle that case. BUG=chromium-os:29092 TEST=GData unittests Review URL: https://chromiumcodereview.appspot.com/10020001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
index 0533d91..2cc0a63 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
@@ -255,9 +255,10 @@ void GDataFileSystemProxy::OnReadDirectory(
base::PlatformFileError error,
const FilePath& directory_path,
GDataFileBase* file) {
- DCHECK(file);
- GDataDirectory* directory = file->AsGDataDirectory();
- if (!directory)
+ DCHECK(file || error != base::PLATFORM_FILE_OK);
+
+ GDataDirectory* directory = file ? file->AsGDataDirectory() : NULL;
+ if (!directory && error == base::PLATFORM_FILE_OK)
error = base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
if (error != base::PLATFORM_FILE_OK) {