Fix null reference error when image upload dialog is closed when image upload finishes
This commit is contained in:
parent
aaa793ad71
commit
7ac555baa0
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user