Skip to content

Commit 9b46128

Browse files
gregaoumichael-ciniawsky
authored andcommittedJan 26, 2018
fix(addStyles): check if HTMLIFrameElement exist (#296)
1 parent a7734e6 commit 9b46128

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/addStyles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var getElement = (function (fn) {
3030
if (typeof memo[selector] === "undefined") {
3131
var styleTarget = fn.call(this, selector);
3232
// Special case to return head of iframe instead of iframe itself
33-
if (styleTarget instanceof window.HTMLIFrameElement) {
33+
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
3434
try {
3535
// This will throw an exception if access to iframe is blocked
3636
// due to cross-origin restrictions

0 commit comments

Comments
 (0)
Please sign in to comment.