From: Marshall Thompson Date: Mon, 6 Jun 2016 15:53:48 +0000 (-0600) Subject: Enable the script to load in DoneJS SSR X-Git-Tag: v6.2.4-rc1~58^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8903%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Enable the script to load in DoneJS SSR Adding this check for `script && script.parentNode` allows foundation-sites to work with DoneJS's Server Side Rendering. --- diff --git a/js/foundation.util.mediaQuery.js b/js/foundation.util.mediaQuery.js index e98555dc2..d9ddce544 100644 --- a/js/foundation.util.mediaQuery.js +++ b/js/foundation.util.mediaQuery.js @@ -142,7 +142,7 @@ window.matchMedia || (window.matchMedia = function() { style.type = 'text/css'; style.id = 'matchmediajs-test'; - script.parentNode.insertBefore(style, script); + script && script.parentNode && script.parentNode.insertBefore(style, script); // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;