From e14a8df6a0961e80c39e0ff5911c9a88d89949e2 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 29 Sep 2012 17:15:09 +0100 Subject: [PATCH] Check typeof parent and swap vars around Checking state.curState.context can cause issues is state.curState doesn't exist so just check state.curState instead Swapped a couple of vars round to match order of usage in func --- lib/coder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coder.js b/lib/coder.js index e0bb0f7..a3b57fb 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -117,7 +117,7 @@ var ICEcoder = { // Set up array to store nest data state = cM.getTokenAt(cM.getCursor()).state; - if ("undefined" != typeof state.curState.context) { + if ("undefined" != typeof state.curState) { ICEcoder.htmlTagArray = []; for (cx = state.curState.context; cx; cx = cx.prev) { ICEcoder.htmlTagArray.unshift(cx.tagName); @@ -444,7 +444,7 @@ var ICEcoder = { // Indicate if the nesting structure of the code is OK updateNestingIndicator: function () { - var cM, fileName, nestOK, endDoc; + var cM, nestOK, fileName, endDoc; cM = ICEcoder.getcMInstance(); nestOK = true;