Skip to content

Commit

Permalink
fix(addStyles): check if HTMLIFrameElement exist (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregaou authored and michael-ciniawsky committed Jan 26, 2018
1 parent a7734e6 commit 9b46128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/addStyles.js
Expand Up @@ -30,7 +30,7 @@ var getElement = (function (fn) {
if (typeof memo[selector] === "undefined") {
var styleTarget = fn.call(this, selector);
// Special case to return head of iframe instead of iframe itself
if (styleTarget instanceof window.HTMLIFrameElement) {
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
try {
// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
Expand Down

0 comments on commit 9b46128

Please sign in to comment.