don't pin falsey document ids

pull/1/head
ansuz 4 years ago
parent d3dd5f991d
commit 5cf8ca70e6

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

Loading…
Cancel
Save