don't pin falsey document ids

This commit is contained in:
ansuz 2020-10-26 17:34:34 +05:30
parent d3dd5f991d
commit 5cf8ca70e6
1 changed files with 2 additions and 2 deletions

View File

@ -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) {