Commit d09d05d8 authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Fix crash on chrome://internals/web-app when BMO is disabled

This code path forgot to early exit from the function.

Bug: 1104250
Change-Id: I16cdbfeaa8028998014476f590ebe6067eff1c1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2308438
Auto-Submit: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790412}
parent 88bc8a42
...@@ -37,13 +37,17 @@ void WebAppInternalsPageHandlerImpl::IsBmoEnabled( ...@@ -37,13 +37,17 @@ void WebAppInternalsPageHandlerImpl::IsBmoEnabled(
void WebAppInternalsPageHandlerImpl::GetWebApps(GetWebAppsCallback callback) { void WebAppInternalsPageHandlerImpl::GetWebApps(GetWebAppsCallback callback) {
auto* provider = web_app::WebAppProviderBase::GetProviderBase(profile_); auto* provider = web_app::WebAppProviderBase::GetProviderBase(profile_);
if (!provider) if (!provider) {
std::move(callback).Run({}); std::move(callback).Run({});
return;
}
web_app::AppRegistrar& registrar_base = provider->registrar(); web_app::AppRegistrar& registrar_base = provider->registrar();
web_app::WebAppRegistrar* registrar = registrar_base.AsWebAppRegistrar(); web_app::WebAppRegistrar* registrar = registrar_base.AsWebAppRegistrar();
if (!registrar) if (!registrar) {
std::move(callback).Run({}); std::move(callback).Run({});
return;
}
std::vector<mojom::web_app_internals::WebAppPtr> result; std::vector<mojom::web_app_internals::WebAppPtr> result;
for (const web_app::WebApp& web_app : registrar->AllApps()) { for (const web_app::WebApp& web_app : registrar->AllApps()) {
......
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