From 5f81287bc619ceb11b8b246647b7350b6e2213ba Mon Sep 17 00:00:00 2001 From: Tycho Bellers Date: Thu, 11 Aug 2022 10:07:19 -0700 Subject: [PATCH] Fix crash when sorting campaigns (#174). Update version number --- package.json | 2 +- src/twitch_drops_bot.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 86289f7..89032cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "twitch_drops_bot", - "version": "1.2.4", + "version": "1.2.5", "description": "A Node.js bot for automatically collecting Twitch drops.", "type": "module", "repository": { diff --git a/src/twitch_drops_bot.ts b/src/twitch_drops_bot.ts index 2d4edba..1fa5162 100644 --- a/src/twitch_drops_bot.ts +++ b/src/twitch_drops_bot.ts @@ -560,7 +560,7 @@ export class TwitchDropsBot extends EventEmitter { #getFirstBroadcasterIndex(campaign: DropCampaign) { for (let i = 0; i < this.#broadcasterIds.length; ++i) { - if (campaign.allow && campaign.allow.isEnabled) { + if (campaign.allow && campaign.allow.isEnabled && campaign.allow.channels) { for (const channel of campaign.allow.channels) { if (channel.displayName.toLowerCase() === this.#broadcasterIds[i].toLowerCase()) { return i;