Skip to content

Commit 82a2ee9

Browse files
committed
Add safe string method access for toTitleCase
1 parent c3b7f07 commit 82a2ee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/components/errors.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const SpecErrorItem = ( { error, jumpToLine } ) => {
113113
}
114114

115115
function toTitleCase(str) {
116-
return str
116+
return (str || "")
117117
.split(" ")
118118
.map(substr => substr[0].toUpperCase() + substr.slice(1))
119119
.join(" ")

0 commit comments

Comments
 (0)