Permalink
Browse files

fix subtle bug where null is at end of array

  • Loading branch information...
1 parent b9bc6d7 commit 55051b97a00bb5d76a9f5da44e6b301381c9bb7d @dominictarr committed Apr 23, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 index.js
View
@@ -110,6 +110,8 @@ var exports = module.exports = function (deps, exports) {
var all = [lcs].concat(q)
function matchLcs (e) {
+ if(e.length && !lcs.length || !e.length && lcs.length)
+ return false //incase the last item is null
return equal(last(e), last(lcs)) || ((e.length + lcs.length) === 0)
}

0 comments on commit 55051b9

Please sign in to comment.