Skip to content

Commit

Permalink
fix: Add null check to removeStyleElement (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandondurham authored and michael-ciniawsky committed May 30, 2017
1 parent f16905c commit 0a4845c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/addStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ function insertStyleElement (options, style) {
}

function removeStyleElement (style) {
if (style.parentNode === null) return false;
style.parentNode.removeChild(style);

var idx = stylesInsertedAtTop.indexOf(style);

if(idx >= 0) {
stylesInsertedAtTop.splice(idx, 1);
}
Expand Down

0 comments on commit 0a4845c

Please sign in to comment.