Skip to content

Commit

Permalink
Add NPE check on model id
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Feb 12, 2025
1 parent b418222 commit 9466a0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/utils/config_to_template_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export function processorConfigsToTemplateProcessors(

let processor = {
ml_inference: {
model_id: model.id,
model_id: model?.id || '',
},
} as MLInferenceProcessor;

Expand Down Expand Up @@ -378,11 +378,11 @@ export function processorConfigsToTemplateProcessors(
);
});
// remove the model field, update to just the required model ID
const model = finalFormValues.model;
const model = finalFormValues?.model;
delete finalFormValues.model;
finalFormValues = {
...finalFormValues,
model_id: model.id,
model_id: model?.id || '',
};

// add the field map config obj
Expand Down

0 comments on commit 9466a0c

Please sign in to comment.