donteatfriedrice
2024-07-29 08:42:22 +00:00
parent 5c62a2b2f5
commit ab11f09b83
10 changed files with 104 additions and 98 deletions

View File

@@ -8,7 +8,7 @@ export async function fetchImageToFile(
): Promise<File | void> {
try {
const res = await fetchImage(url, undefined, imageProxy);
if (res.ok) {
if (res && res.ok) {
let blob = await res.blob();
if (!blob.type || !blob.type.startsWith('image/')) {
blob = await convertToPng(blob).then(tmp => tmp || blob);