Skip to content

Commit

Permalink
Check for emptiness of case.split function input (#3985)
Browse files Browse the repository at this point in the history
Co-authored-by: Olga Bulat <[email protected]>
  • Loading branch information
krysal and obulat authored Mar 29, 2024
1 parent 5bfab8b commit 6b31766
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/utils/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const SPLIT_REPLACE_VALUE = "$1\0$2"
/**
* Split any cased input strings into an array of words.
*/
function split(input: string) {
function split(input: string | undefined) {
if (!input) {
return []
}

let result = input.trim()

result = result
Expand Down

0 comments on commit 6b31766

Please sign in to comment.