Skip to content

Commit

Permalink
Merge pull request #4719 from jfkonecn/hotfix
Browse files Browse the repository at this point in the history
search returns false for bad regex
  • Loading branch information
alisman authored Sep 12, 2023
2 parents b96e11e + 6cfd9ae commit 7d889f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ cert.pem
end
e2e-localdb-workspace/
junit.xml
.nvim.lua
.luarc.json
20 changes: 12 additions & 8 deletions src/shared/lib/GenericAssayUtils/GenericAssaySelectionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ export interface ISelectOption {
}

export function doesOptionMatchSearchText(text: string, option: ISelectOption) {
let result = false;
if (
!text ||
RegExp(text, 'i').test(option.label) ||
RegExp(text, 'i').test(option.value)
) {
result = true;
try {
let result = false;
if (
!text ||
RegExp(text, 'i').test(option.label) ||
RegExp(text, 'i').test(option.value)
) {
result = true;
}
return result;
} catch {
return false;
}
return result;
}

0 comments on commit 7d889f6

Please sign in to comment.