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

Unified Diff: extensions/browser/guest_view/extension_options/extension_options_guest.cc

Issue 655143003: Don't try to create extensionoptions for extensions that don't exist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « chrome/test/data/extensions/webui/can_embed_extension_options.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/extension_options/extension_options_guest.cc
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
index ef79ee704918a5a009fff7995a441d0950e0be8f..66c9abae998af2bf8ffb0f96a1396f2f29df00c9 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
@@ -91,6 +91,13 @@ void ExtensionOptionsGuest::CreateWebContents(
extensions::ExtensionRegistry::Get(browser_context());
const extensions::Extension* extension =
registry->enabled_extensions().GetByID(extension_id);
+ if (!extension) {
+ // The ID was valid but the extension didn't exist. Typically this will
+ // happen when an extension is disabled.
+ callback.Run(NULL);
+ return;
+ }
+
options_page_ = extensions::OptionsPageInfo::GetOptionsPage(extension);
if (!options_page_.is_valid()) {
callback.Run(NULL);
« no previous file with comments | « chrome/test/data/extensions/webui/can_embed_extension_options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698