don't pin falsey document ids

pull/1/head
ansuz 4 years ago
parent a87d0f2943
commit f7bd3bdc23

@ -162,7 +162,7 @@ Pinning.pinChannel = function (Env, safeKey, channels, cb) {
// only pin channels which are not already pinned
var toStore = channels.filter(function (channel) {
return pinned.indexOf(channel) === -1;
return channel && pinned.indexOf(channel) === -1;
});
if (toStore.length === 0) {
@ -204,7 +204,7 @@ Pinning.unpinChannel = function (Env, safeKey, channels, cb) {
// only unpin channels which are pinned
var toStore = channels.filter(function (channel) {
return pinned.indexOf(channel) !== -1;
return channel && pinned.indexOf(channel) !== -1;
});
if (toStore.length === 0) {

Loading…
Cancel
Save