Fix error on broken image

This commit is contained in:
CenTdemeern1 2025-01-14 17:51:22 +01:00
parent 6db0c3fc19
commit 310eb0bc78

View file

@ -59,12 +59,18 @@ export function initializeInstanceDetailsDialog(
}; };
form.addEventListener("submit", e => { form.addEventListener("submit", e => {
let image: string | null = null;
if (instanceIcon.src !== blankImage) {
try {
image = resize(instanceIcon);
} catch { }
}
callback( callback(
instanceName.value, instanceName.value,
instanceHost.value, instanceHost.value,
instanceHostSecure.checked, instanceHostSecure.checked,
instanceSoftware.value, instanceSoftware.value,
instanceIcon.src == blankImage ? null : resize(instanceIcon) image
); );
form.reset(); form.reset();
}); });