Skip to content

Commit 099b947

Browse files
author
Weedshaker
committed
escapeHTML func fix
1 parent dbadb85 commit 099b947

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/helpers/Helpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export const scrollElIntoView = (getScrollElFunc, notIntersectingSelector = null
5252

5353
// https://stackoverflow.com/questions/30661497/xss-prevention-and-innerhtml
5454
export const escapeHTML = unsafe_str => {
55+
if (!unsafe_str) return ''
5556
return unsafe_str
5657
.replace(/&/g, '&')
5758
.replace(/</g, '&lt;')

0 commit comments

Comments
 (0)