diff --git a/met-web/src/utils/index.ts b/met-web/src/utils/index.ts index 1ffdae549..a291ee300 100644 --- a/met-web/src/utils/index.ts +++ b/met-web/src/utils/index.ts @@ -1,6 +1,9 @@ import { AxiosResponse } from 'axios'; export function hasKey(obj: O, key: PropertyKey): key is keyof O { + if (typeof obj !== 'object' || !obj) { + return false; + } return key in obj; }