Commit 4f8f50d2 authored by lfg's avatar lfg Committed by Commit bot

Verify that ComponentExtensionResourceManager exists before using it.

App_shell doesn't have a ComponentExtensionResourceManager implementation, so we need to check if it's available before using it.

BUG=352293

Review URL: https://codereview.chromium.org/615703002

Cr-Commit-Position: refs/heads/master@{#297299}
parent e65fb36c
...@@ -206,11 +206,13 @@ bool ExecuteCodeFunction::RunAsync() { ...@@ -206,11 +206,13 @@ bool ExecuteCodeFunction::RunAsync() {
} }
int resource_id; int resource_id;
if (ExtensionsBrowserClient::Get() ComponentExtensionResourceManager* component_extension_resource_manager =
->GetComponentExtensionResourceManager() ExtensionsBrowserClient::Get()->GetComponentExtensionResourceManager();
->IsComponentExtensionResource(resource_.extension_root(), if (component_extension_resource_manager &&
resource_.relative_path(), component_extension_resource_manager->IsComponentExtensionResource(
&resource_id)) { resource_.extension_root(),
resource_.relative_path(),
&resource_id)) {
const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
DidLoadFile(true, rb.GetRawDataResource(resource_id).as_string()); DidLoadFile(true, rb.GetRawDataResource(resource_id).as_string());
} else { } else {
......
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