Skip to content

Commit

Permalink
[NIFI-14151] catch error from illegal character in extension creation…
Browse files Browse the repository at this point in the history
… dialog filter (apache#9633)

This closes apache#9633
  • Loading branch information
scottyaslan authored Jan 15, 2025
1 parent 53911bb commit eeae16b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('matchesCamelCaseSearch', () => {

it.each([
{ value, query: '', expectedResult: false },
{ value, query: '[', expectedResult: false },
{ value, query: value, expectedResult: true },
{ value, query: 'Generate', expectedResult: true },
{ value, query: 'GFlowFile', expectedResult: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,14 @@ export function matchesCamelCaseSearch(value: string, filter: string): boolean {
}

const joinedParts = camelCaseMatches.join('.*');
return new RegExp(joinedParts).test(value);

let doesMatch = false;

try {
doesMatch = new RegExp(joinedParts).test(value)
} catch (e) {
// ignore
}

return doesMatch;
}

0 comments on commit eeae16b

Please sign in to comment.