Skip to content

Commit

Permalink
Fix handling of function without library for Equal
Browse files Browse the repository at this point in the history
  • Loading branch information
lmd59 committed Dec 10, 2024
1 parent 87786bd commit 1fc6393
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/helpers/elm/QueryFilterParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

Check warning on line 724 in src/helpers/elm/QueryFilterParser.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
return { type: 'unknown', withError };

Check warning on line 725 in src/helpers/elm/QueryFilterParser.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 726 in src/helpers/elm/QueryFilterParser.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

if (isOfTypeGracefulError(propRef)) {
return { type: 'unknown', withError: propRef };
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/errors/GracefulError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 9 in src/types/errors/GracefulError.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
return true;
}
return false;
Expand Down

0 comments on commit 1fc6393

Please sign in to comment.