From 9bae5eaea701413adf053c21a6e153ad302883e1 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 3 May 2021 19:33:59 +0300 Subject: [PATCH] Fix error when adding counter without triggers --- backend/src/plugins/Counters/CountersPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Counters/CountersPlugin.ts b/backend/src/plugins/Counters/CountersPlugin.ts index 8b8f0f15..6d1d5357 100644 --- a/backend/src/plugins/Counters/CountersPlugin.ts +++ b/backend/src/plugins/Counters/CountersPlugin.ts @@ -62,7 +62,7 @@ const configPreprocessor: ConfigPreprocessorFn = options => counter.per_user = counter.per_user ?? false; counter.per_channel = counter.per_channel ?? false; counter.initial_value = counter.initial_value ?? 0; - counter.triggers = counter.triggers || []; + counter.triggers = counter.triggers || {}; if (Object.values(counter.triggers).length > MAX_TRIGGERS_PER_COUNTER) { throw new StrictValidationError([`You can only have at most ${MAX_TRIGGERS_PER_COUNTER} triggers per counter`]);