summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheia2023-02-02 09:46:23 -0500
committertheia2023-02-02 09:46:23 -0500
commite88fae3261abea5522c1f8560b33e6e23fb1d1fd (patch)
treed3b428591b799256f4eb81830202017b6918f1f5
parent161e34c96c81b7cf20f0c4d86e297f4a7110c6f0 (diff)
filter null tags
-rw-r--r--graffiti.js3
1 files changed, 3 insertions, 0 deletions
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 = []