From 63a55610bad8d36ba18bf057c817e2805a929c09 Mon Sep 17 00:00:00 2001 From: expouic Date: Fri, 13 Dec 2013 11:45:51 +0000 Subject: [PATCH] Update formatting.js Prevent dispatch Uncaught TypeError when styleTag is null --- src/core/formatting.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/formatting.js b/src/core/formatting.js index 4c40ac1..3439a66 100644 --- a/src/core/formatting.js +++ b/src/core/formatting.js @@ -109,7 +109,9 @@ Monocle.Formatting = function (reader, optStyles, optScale) { while (cmpt = p.reader.dom.find('component', i++)) { var doc = cmpt.contentDocument; var styleTag = doc.getElementById('monStylesheet'+sheetIndex); - styleTag.parentNode.removeChild(styleTag); + if (styleTag !== null){ + styleTag.parentNode.removeChild(styleTag); + } } }); }