Commit eeeea131 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

Trying to check className on script nodes or comment nodes gives an undefined error

parent b777681e
......@@ -6,7 +6,7 @@ var Unl = {};
Unl.hasParentNodeWithClass = function(childNode, parentClass) {
for (var selectedNode = childNode; selectedNode.id != 'maincontent'; selectedNode = selectedNode.parentNode) {
if (selectedNode.className.search(parentClass) >= 0) {
if (typeof selectedNode.className !== 'undefined' && selectedNode.className.search(parentClass) >= 0) {
return selectedNode;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment