Bug 10190: fix NaN trigger number when adding first rule for a library

When no circulation rules exist for a library, triggerCounts[library_id]
is undefined, causing undefined + 1 = NaN. Use nullish coalescing to
default to 0 so the first trigger correctly gets number 1.

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-02-25 14:06:07 +00:00 committed by Pedro Amorim
parent 7413d2724e
commit 17c3aab6c4
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 1 additions and 1 deletions

View File

@ -688,7 +688,7 @@ export default {
this.triggerNumber =
this.editMode === "edit"
? triggerNumber
: this.triggerCounts[library_id] + 1;
: (this.triggerCounts[library_id] ?? 0) + 1;
},
setFallbackRuleSet() {
this.fallbackRuleSet = {