Skip to content

Commit

Permalink
[PWA] Fix PWA mobile model metadata processing issues
Browse files Browse the repository at this point in the history
Add a check for input_context to prevent crash when input_context is null after reaching custom input processor.

Enforce input context based custom input features to be float only.

(cherry picked from commit f9a7487)

Bug: b/278782487
Change-Id: Ia75a9a562a8fb3c3821156c076df373f0d260a4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4611100
Reviewed-by: Ella Ge <eirage@chromium.org>
Commit-Queue: Hailey Wang <haileywang@google.com>
Reviewed-by: Siddhartha S <ssid@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1158417}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4702084
Reviewed-by: Sam Maier <smaier@chromium.org>
Reviewed-by: Hailey Wang <haileywang@google.com>
Commit-Queue: Krishna Govind <govind@chromium.org>
Cr-Commit-Position: refs/branch-heads/5790@{#1775}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
“Hailey authored and Chromium LUCI CQ committed Jul 20, 2023
1 parent ff80b62 commit 2e102a4
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -234,6 +234,13 @@ bool CustomInputProcessor::AddFromInputContext(
return false;
}
const auto& input_context = feature_processor_state->input_context();
if (!input_context) {
feature_processor_state->SetError(
stats::FeatureProcessingError::kCustomInputError,
"input context missing");
return false;
}

auto input_name = custom_input.name();
auto custom_input_iter = custom_input.additional_args().find("name");
if (custom_input_iter != custom_input.additional_args().end()) {
Expand Down

0 comments on commit 2e102a4

Please sign in to comment.