Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc

Issue 11196007: Fix media galleries crash when the window is closed with config dialog open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
index 143096434049f2dd0f0a93cd83661e98d0f8056c..98f89cce98f198aa247ed01abfe876b9ad21e579 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
@@ -121,7 +121,12 @@ void MediaGalleriesGetMediaFileSystemsFunction::GetAndReturnGalleries() {
void MediaGalleriesGetMediaFileSystemsFunction::ReturnGalleries(
const std::vector<MediaFileSystemInfo>& filesystems) {
- const int child_id = render_view_host()->GetProcess()->GetID();
+ content::RenderViewHost* rvh = render_view_host();
+ if (!rvh) {
+ SendResponse(false);
+ return;
+ }
+ const int child_id = rvh->GetProcess()->GetID();
std::set<std::string> file_system_names;
base::ListValue* list = new base::ListValue();
for (size_t i = 0; i < filesystems.size(); i++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698