Commit bb9dd87c authored by satorux@chromium.org's avatar satorux@chromium.org

gdata: Fix a bug that caused a crash when downloading files

GetDownloadDataCallback parameter in GDataFileSystem::GetFileByPath()
was optional hence a null callback was passed in many places, and
the null callback was posted to a message loop without checking if
it's null or not.

BUG=chromium-os:30198
TEST=double clicking on an image file on gdata; copy-pasting from gdata to Downloads; both don't crash

Review URL: https://chromiumcodereview.appspot.com/10288006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134808 0039d316-1c4b-4281-b951-d872f2087c98
parent 13e3c1f7
......@@ -773,6 +773,10 @@ void RelayGetDownloadDataCallback(
const GetDownloadDataCallback& callback,
GDataErrorCode error,
scoped_ptr<std::string> download_data) {
// Unlike other callbacks, GetDownloadDataCallback is optional, hence it
// can be null here.
if (callback.is_null())
return;
relay_proxy->PostTask(
FROM_HERE,
base::Bind(callback, error, base::Passed(&download_data)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment