diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js index 0132fe9e18..a607b6e4ce 100644 --- a/ext/js/pages/settings/dictionary-controller.js +++ b/ext/js/pages/settings/dictionary-controller.js @@ -716,8 +716,8 @@ export class DictionaryController { /** */ _onDictionaryMoveButtonClick() { const modal = /** @type {import('./modal.js').Modal} */ (this._modalController.getModal('dictionary-move-location')); - const {index} = modal.node.dataset; - if (typeof index !== 'number') { return; } + const index = modal.node.dataset.index ?? ''; + if (isNaN(+index)) { return; } const indexNumber = Number.parseInt(index, 10); /** @type {HTMLInputElement} */