From f16f071e5a8972de8200f29333d875940c4a3a03 Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Mon, 6 Jun 2016 09:53:48 -0600 Subject: [PATCH] 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. --- js/foundation.util.mediaQuery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.2