diff options
author | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-23 02:50:48 +0000 |
---|---|---|
committer | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-23 02:50:48 +0000 |
commit | 81d18247d8dafe7ca6bfdaecb394f06f1f4448d8 (patch) | |
tree | a7b3fa0cca5c322a97a444fe973f3f45b66873b5 | |
parent | 0cb0761db9b7a54a2102b8e0f7975ed221d04e80 (diff) | |
download | chromium_src-81d18247d8dafe7ca6bfdaecb394f06f1f4448d8.zip chromium_src-81d18247d8dafe7ca6bfdaecb394f06f1f4448d8.tar.gz chromium_src-81d18247d8dafe7ca6bfdaecb394f06f1f4448d8.tar.bz2 |
[Media Gallery] Added a NULL check in MediaGalleryExtensionNotificationObserver::Observe.
BUG=171361
TEST=none
Review URL: https://chromiumcodereview.appspot.com/12042037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178220 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/api/media_galleries_private/media_gallery_extension_notification_observer.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/extensions/api/media_galleries_private/media_gallery_extension_notification_observer.cc b/chrome/browser/extensions/api/media_galleries_private/media_gallery_extension_notification_observer.cc index 9e7eee2..751e990 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_gallery_extension_notification_observer.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_gallery_extension_notification_observer.cc @@ -63,17 +63,19 @@ void MediaGalleryExtensionNotificationObserver::Observe( extension = const_cast<Extension*>( content::Details<extensions::UnloadedExtensionInfo>( details)->extension); + DCHECK(extension); } else { DCHECK(type == chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED); ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); extension = const_cast<Extension*>(host->extension()); + if (!extension) + return; } - DCHECK(extension); content::BrowserThread::PostTask( - content::BrowserThread::FILE, FROM_HERE, - base::Bind(&HandleExtensionDestroyedOnFileThread, - profile_, - extension->id())); + content::BrowserThread::FILE, FROM_HERE, + base::Bind(&HandleExtensionDestroyedOnFileThread, + profile_, + extension->id())); } } // namespace extensions |