Skip to content

Commit 457b550

Browse files
committed
Update index.js
Adds null check for string splitting.
1 parent 8607b83 commit 457b550

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@
434434
}
435435

436436
function titleCase(str) {
437-
return str.split(' ').map(function (val) {
437+
return str == null? null : str.split(' ').map(function (val) {
438438
return val.charAt(0).toUpperCase() + val.substr(1).toLowerCase();
439439
}).join(' ');
440440
}

0 commit comments

Comments
 (0)