diff --git a/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts b/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts index a5c8eb7e6b66c..1a945512f7cd9 100644 --- a/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts +++ b/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts @@ -62,7 +62,7 @@ export const createMLJob = async ({ }; } else { const { error } = jobResponse; - throw new Error(error.msg); + throw new Error(error?.msg); } } else { return null;