From 6988b1094b80968b382539e56695e09f3de564fb Mon Sep 17 00:00:00 2001 From: melton-jason Date: Fri, 26 Jan 2024 08:53:54 -0600 Subject: [PATCH 1/2] Handle case when scope object is null --- .../frontend/js_src/lib/components/DataModel/businessRules.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts b/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts index d19beeee7a5..9cbb7170e5d 100644 --- a/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts +++ b/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts @@ -365,7 +365,7 @@ export class BusinessRuleManager { ]) ); - if (Object.values(partialFilters).includes(undefined)) + if (Object.values(partialFilters).includes(undefined) || partialFilters[rule.scopes[0]] === null) return { valid: true }; return new this.resource.specifyModel.LazyCollection({ From 915c9b082d57e3cb67f1b127c25cc71bd9cec6fd Mon Sep 17 00:00:00 2001 From: melton-jason Date: Fri, 26 Jan 2024 14:58:41 +0000 Subject: [PATCH 2/2] Lint code with ESLint and Prettier Triggered by 6988b1094b80968b382539e56695e09f3de564fb on branch refs/heads/issue-4464 --- .../js_src/lib/components/DataModel/businessRules.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts b/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts index 9cbb7170e5d..ab4f44c984b 100644 --- a/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts +++ b/specifyweb/frontend/js_src/lib/components/DataModel/businessRules.ts @@ -365,7 +365,10 @@ export class BusinessRuleManager { ]) ); - if (Object.values(partialFilters).includes(undefined) || partialFilters[rule.scopes[0]] === null) + if ( + Object.values(partialFilters).includes(undefined) || + partialFilters[rule.scopes[0]] === null + ) return { valid: true }; return new this.resource.specifyModel.LazyCollection({