Fix null reference error when image upload dialog is closed when image upload finishes

This commit is contained in:
Mitchell McCaffrey 2020-11-26 16:32:48 +11:00
parent aaa793ad71
commit 7ac555baa0
2 changed files with 6 additions and 2 deletions

View File

@ -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) {

View File

@ -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) {