Skip to content

Commit 35211ed

Browse files
committed
pre might be null or undefined and throw an error when .slice() is called on it
1 parent d3afe47 commit 35211ed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/getPrefix.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = function() {
88
.match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o'])
99
)[1];
1010
// 'ms' is not titlecased
11+
if(pre === undefined || pre === null) return '';
1112
if (pre === 'ms') return pre;
1213
return pre.slice(0, 1).toUpperCase() + pre.slice(1);
1314
};

0 commit comments

Comments
 (0)