Skip to content

Commit

Permalink
[ML] add conditional call for uiSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Aug 18, 2021
1 parent 23b5355 commit c263baf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/ml/server/shared_services/shared_services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function getRequestItemsProvider(
);
}

const uiSettingsClient = getUiSettings()!.asScopedToClient(savedObjectsClient);
const uiSettingsClient = getUiSettings()?.asScopedToClient(savedObjectsClient);
if (uiSettingsClient === null) {
throw getCustomError(
'MLUISettingsClientUninitialized',
Expand All @@ -209,7 +209,7 @@ function getRequestItemsProvider(
const getFieldsFormatRegistry = async () => {
let fieldFormatRegistry;
try {
fieldFormatRegistry = await getFieldsFormat()!.fieldFormatServiceFactory(uiSettingsClient);
fieldFormatRegistry = await getFieldsFormat()!.fieldFormatServiceFactory(uiSettingsClient!);
} catch (e) {
// throw an custom error during the fieldFormatRegistry check
}
Expand Down

0 comments on commit c263baf

Please sign in to comment.