return `null` for non-existing elements

This commit is contained in:
gorhill 2015-12-13 00:17:38 -05:00
parent 1d448b85b2
commit 47f6a565fa
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ var doesMatchSelector = function(node, selector) {
/******************************************************************************/
DOMList.prototype.nodeAt = function(i) {
return this.nodes[i];
return this.nodes[i] || null;
};
DOMList.prototype.at = function(i) {