Chromium Code Reviews| Index: extensions/common/permissions/permissions_data.cc |
| diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc |
| index 73afe4373fbc9bbca9f5bca1b34f53e8504cd6e9..6eb819993c4744382b2ef236c1bd29b82c1b7aa5 100644 |
| --- a/extensions/common/permissions/permissions_data.cc |
| +++ b/extensions/common/permissions/permissions_data.cc |
| @@ -77,7 +77,7 @@ bool PermissionsData::IsRestrictedUrl(const GURL& document_url, |
| const GURL& top_frame_url, |
| const Extension* extension, |
| std::string* error) { |
| - if (CanExecuteScriptEverywhere(extension)) |
| + if (extension && CanExecuteScriptEverywhere(extension)) |
|
sadrul
2014/08/06 18:51:51
The null checks here are necessary since some test
not at google - send to devlin
2014/08/06 22:10:28
yeah this change is correct no matter what the con
|
| return false; |
| // Check if the scheme is valid for extensions. If not, return. |
| @@ -103,9 +103,8 @@ bool PermissionsData::IsRestrictedUrl(const GURL& document_url, |
| return true; |
| } |
| - if (top_frame_url.SchemeIs(kExtensionScheme) && |
| - top_frame_url.host() != extension->id() && |
| - !allow_on_chrome_urls) { |
| + if (extension && top_frame_url.SchemeIs(kExtensionScheme) && |
| + top_frame_url.host() != extension->id() && !allow_on_chrome_urls) { |
| if (error) |
| *error = manifest_errors::kCannotAccessExtensionUrl; |
| return true; |