From 9555fe01675bafcd69625375947ac06ce40a5747 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Mon, 26 Nov 2018 11:29:56 -0800 Subject: [PATCH] Improve error message when kernel not set (flutter/engine#6924) Pushes the check up front so that we don't always land on the application_kernel_list_asset error message, which may be misleading to readers. Also switches the empty check to only emit in debug builds, since this is almost certainly not a runtime error but a programmer error. --- .../src/flutter/shell/common/isolate_configuration.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/common/isolate_configuration.cc b/engine/src/flutter/shell/common/isolate_configuration.cc index 59cc56682b..173973b64e 100644 --- a/engine/src/flutter/shell/common/isolate_configuration.cc +++ b/engine/src/flutter/shell/common/isolate_configuration.cc @@ -153,6 +153,13 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( return nullptr; } + if (settings.application_kernel_asset.empty() && + settings.application_kernel_list_asset.empty()) { + FML_DLOG(ERROR) << "application_kernel_asset or " + "application_kernel_list_asset must be set"; + return nullptr; + } + // Running from kernel snapshot. { std::unique_ptr kernel = @@ -164,10 +171,6 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( // Running from kernel divided into several pieces (for sharing). { - if (settings.application_kernel_list_asset.empty()) { - FML_LOG(ERROR) << "Application kernel list asset not set"; - return nullptr; - } std::unique_ptr kernel_list = asset_manager->GetAsMapping(settings.application_kernel_list_asset); if (!kernel_list) {