From e88fae3261abea5522c1f8560b33e6e23fb1d1fd Mon Sep 17 00:00:00 2001 From: theia Date: Thu, 2 Feb 2023 09:46:23 -0500 Subject: filter null tags --- graffiti.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graffiti.js b/graffiti.js index ad456b1..9c5b188 100644 --- a/graffiti.js +++ b/graffiti.js @@ -230,6 +230,7 @@ export default class { } objectsByTags(...tags) { + tags = tags.filter(tag=> tag!=null) for (const tag of tags) { if (!(tag in this.tagMap)) { throw `You are not subscribed to '${tag}'` @@ -245,6 +246,7 @@ export default class { } async subscribe(...tags) { + tags = tags.filter(tag=> tag!=null) // Look at what is already subscribed to const subscribingTags = [] for (const tag of tags) { @@ -267,6 +269,7 @@ export default class { } async unsubscribe(...tags) { + tags = tags.filter(tag=> tag!=null) // Decrease the count of each tag, // removing and marking if necessary const unsubscribingTags = [] -- cgit v1.2.3-70-g09d2