diff --git a/src/modals/SelectMapModal.js b/src/modals/SelectMapModal.js index 96e7184..d9930f6 100644 --- a/src/modals/SelectMapModal.js +++ b/src/modals/SelectMapModal.js @@ -95,7 +95,9 @@ function SelectMapModal({ await handleImageUpload(file); } // Set file input to null to allow adding the same image 2 times in a row - fileInputRef.current.value = null; + if (fileInputRef.current) { + fileInputRef.current.value = null; + } } async function handleImageUpload(file) { diff --git a/src/modals/SelectTokensModal.js b/src/modals/SelectTokensModal.js index f13c3e5..89ee6ee 100644 --- a/src/modals/SelectTokensModal.js +++ b/src/modals/SelectTokensModal.js @@ -74,7 +74,9 @@ function SelectTokensModal({ isOpen, onRequestClose }) { await handleImageUpload(file); } // Set file input to null to allow adding the same image 2 times in a row - fileInputRef.current.value = null; + if (fileInputRef.current) { + fileInputRef.current.value = null; + } } async function handleImageUpload(file) {