Fix null reference error when image upload dialog is closed when image upload finishes
This commit is contained in:
parent
aaa793ad71
commit
7ac555baa0
@ -95,8 +95,10 @@ function SelectMapModal({
|
||||
await handleImageUpload(file);
|
||||
}
|
||||
// Set file input to null to allow adding the same image 2 times in a row
|
||||
if (fileInputRef.current) {
|
||||
fileInputRef.current.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleImageUpload(file) {
|
||||
if (!file) {
|
||||
|
@ -74,8 +74,10 @@ function SelectTokensModal({ isOpen, onRequestClose }) {
|
||||
await handleImageUpload(file);
|
||||
}
|
||||
// Set file input to null to allow adding the same image 2 times in a row
|
||||
if (fileInputRef.current) {
|
||||
fileInputRef.current.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleImageUpload(file) {
|
||||
let name = "Unknown Map";
|
||||
|
Loading…
Reference in New Issue
Block a user