From 3003f957a716e2d45b9063cb14d45fe487543fe9 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Mon, 15 Apr 2024 19:29:14 +0200 Subject: [PATCH] edge case --- ext/js/language/translator.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js index 5ed5d57bb9..6132ee823a 100644 --- a/ext/js/language/translator.js +++ b/ext/js/language/translator.js @@ -2080,6 +2080,7 @@ export class Translator { * @returns {number} */ _getShortestInflectionChainLength(inflectionRuleChainCandidates) { + if (inflectionRuleChainCandidates.length === 0) { return 0; } let length = Number.MAX_SAFE_INTEGER; for (const {inflectionRules} of inflectionRuleChainCandidates) { length = Math.min(length, inflectionRules.length);