diff --git a/src/plugins/kibana_utils/common/create_getter_setter.ts b/src/plugins/kibana_utils/common/create_getter_setter.ts index 14f8c67d9598f..b410413c62bcb 100644 --- a/src/plugins/kibana_utils/common/create_getter_setter.ts +++ b/src/plugins/kibana_utils/common/create_getter_setter.ts @@ -21,10 +21,10 @@ export type Get = () => T; export type Set = (value: T) => void; export const createGetterSetter = (name: string): [Get, Set] => { - let value: T; + let value: T | undefined; const get: Get = () => { - if (!value) throw new Error(`${name} was not set.`); + if (value === undefined) throw new Error(`${name} was not set.`); return value; };