From 541a99bbc5f2af42ee65c852f95c1193d4a373f5 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Tue, 10 Feb 2015 18:56:32 +0100 Subject: [PATCH] Fix item removal. --- packages/xo-lib/collection.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/xo-lib/collection.js b/packages/xo-lib/collection.js index dedbc1999..ee8277f7c 100644 --- a/packages/xo-lib/collection.js +++ b/packages/xo-lib/collection.js @@ -129,6 +129,12 @@ Collection.prototype.set = function (item) { }; Collection.prototype.unset = function (item) { + var key = this._key(item); + item = this._data[key]; + if (!item) { + return; + } + unset.call(this, item, this._key(item)); };