diff options
author | Jake <148171160+jbukl@users.noreply.github.com> | 2024-01-13 00:17:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-13 05:17:08 +0000 |
commit | 2aea9291d66fd619c484abc2ab04b4350807f308 (patch) | |
tree | c502faf10dfb7502260d4c452b334d49ed1a4ecb | |
parent | 36c40ff671ae1f8a05aac77c8694e9bccdda85fb (diff) |
Fix dictionary move to index (#514)
* Fix dictionary move to index
* Use number isnan
-rw-r--r-- | ext/js/pages/settings/dictionary-controller.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js index 0132fe9e..81b781da 100644 --- a/ext/js/pages/settings/dictionary-controller.js +++ b/ext/js/pages/settings/dictionary-controller.js @@ -716,9 +716,9 @@ 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 ?? ''; const indexNumber = Number.parseInt(index, 10); + if (Number.isNaN(indexNumber)) { return; } /** @type {HTMLInputElement} */ const targetStringInput = querySelectorNotNull(document, '#dictionary-move-location'); |