From 145e3ece780e6958284f150d232b045c4ba108d0 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 12 Nov 2013 22:01:31 +0000 Subject: [PATCH] Fix $tw.utils.hasClass() to work even if the element doesn't have a className property --- core/modules/utils/dom/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/utils/dom/dom.js b/core/modules/utils/dom/dom.js index f95e89c97..87447f505 100644 --- a/core/modules/utils/dom/dom.js +++ b/core/modules/utils/dom/dom.js @@ -29,7 +29,7 @@ exports.removeChildren = function(node) { }; exports.hasClass = function(el,className) { - return el.className.split(" ").indexOf(className) !== -1; + return el && el.className && el.className.split(" ").indexOf(className) !== -1; }; exports.addClass = function(el,className) {