Skip to content

Commit 0a4845c

Browse files
brandondurhammichael-ciniawsky
authored andcommitted
fix: Add null check to removeStyleElement (#245)
1 parent f16905c commit 0a4845c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/addStyles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ function insertStyleElement (options, style) {
166166
}
167167

168168
function removeStyleElement (style) {
169+
if (style.parentNode === null) return false;
169170
style.parentNode.removeChild(style);
170171

171172
var idx = stylesInsertedAtTop.indexOf(style);
172-
173173
if(idx >= 0) {
174174
stylesInsertedAtTop.splice(idx, 1);
175175
}

0 commit comments

Comments
 (0)