Skip to content

Commit

Permalink
Merge pull request knockout#423 from SteveSanderson/411-tagnamelower-…
Browse files Browse the repository at this point in the history
…check

Make tagNameLower resilient against unexpected inputs
  • Loading branch information
mbest committed Apr 4, 2012
2 parents b768098 + 36225f9 commit 4ab69a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ ko.utils = new (function () {
// For HTML elements, tagName will always be upper case; for XHTML elements, it'll be lower case.
// Possible future optimization: If we know it's an element from an XHTML document (not HTML),
// we don't need to do the .toLowerCase() as it will always be lower case anyway.
return element.tagName.toLowerCase();
return element && element.tagName && element.tagName.toLowerCase();
},

registerEventHandler: function (element, eventType, handler) {
Expand Down

0 comments on commit 4ab69a9

Please sign in to comment.