From 349129ffd237f797b697a97f691a12e91e6d047a Mon Sep 17 00:00:00 2001 From: jbukl <148171160+jbukl@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:29:13 -0500 Subject: [PATCH] Fix dictionary move to index --- ext/js/pages/settings/dictionary-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js index 0132fe9e18..72b6f9cd4c 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 (isNaN(indexNumber)) { return; } /** @type {HTMLInputElement} */ const targetStringInput = querySelectorNotNull(document, '#dictionary-move-location');