diff --git a/src/helpers/elm/QueryFilterParser.ts b/src/helpers/elm/QueryFilterParser.ts index 067dcefd..306d0e68 100644 --- a/src/helpers/elm/QueryFilterParser.ts +++ b/src/helpers/elm/QueryFilterParser.ts @@ -720,6 +720,11 @@ export function interpretEqual(equal: ELMEqual, library: ELM): EqualsFilter | Un propRef = equal.operand[0] as ELMProperty; } + if (propRef == null) { + withError.message = `could not resolve property ref for Equal:${equal.localId}. first operand is a ${equal.operand[0].type}`; + return { type: 'unknown', withError }; + } + if (isOfTypeGracefulError(propRef)) { return { type: 'unknown', withError: propRef }; } diff --git a/src/types/errors/GracefulError.ts b/src/types/errors/GracefulError.ts index 40f4460d..86c947b1 100644 --- a/src/types/errors/GracefulError.ts +++ b/src/types/errors/GracefulError.ts @@ -6,7 +6,7 @@ export interface GracefulError { } export const isOfTypeGracefulError = (tbd: any): tbd is GracefulError => { - if ((tbd as GracefulError).message) { + if ((tbd as GracefulError)?.message) { return true; } return false;