Fix crash when unable to resize image

This commit is contained in:
Mitchell McCaffrey
2021-02-14 08:35:43 +11:00
parent 8440a8de42
commit 2f4e671390
2 changed files with 11 additions and 9 deletions

View File

@@ -190,14 +190,16 @@ function SelectMapModal({
file.type,
resolution.quality
);
const resizedBuffer = await blobToBuffer(resized.blob);
resolutions[resolution.id] = {
file: resizedBuffer,
width: resized.width,
height: resized.height,
type: "file",
id: resolution.id,
};
if (resized.blob) {
const resizedBuffer = await blobToBuffer(resized.blob);
resolutions[resolution.id] = {
file: resizedBuffer,
width: resized.width,
height: resized.height,
type: "file",
id: resolution.id,
};
}
}
}
// Create thumbnail