Skip to content

Commit 5738aa7

Browse files
committed
Prevent CSS class listing from failing for elements with no CSS classes (fixes #473)
1 parent 4e52a25 commit 5738aa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/lib/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
* List the classes of a DOM element without using elt.classList (for compatibility with IE 9)
164164
*/
165165
object.getCssClasses = function (elt) {
166-
return elt.className.match(/\S+/g);
166+
return elt.className.match(/\S+/g) || [];
167167
};
168168

169169
/*

0 commit comments

Comments
 (0)