Handle case where _lower_bound returns size of input list

(imported from commit bd91512615b11935eafd5809ca414eeb0cf189c4)
This commit is contained in:
Leo Franchi
2014-03-12 15:39:04 -04:00
parent fa1333c026
commit e7c8c322c0

View File

@@ -246,7 +246,7 @@ MessageList.prototype = {
var closest = this._lower_bound(id);
if (id === items[closest].id) {
if (closest < items.length && id === items[closest].id) {
return items[closest].id;
}