Fix error on broken image
This commit is contained in:
parent
6db0c3fc19
commit
310eb0bc78
1 changed files with 7 additions and 1 deletions
|
@ -59,12 +59,18 @@ export function initializeInstanceDetailsDialog(
|
|||
};
|
||||
|
||||
form.addEventListener("submit", e => {
|
||||
let image: string | null = null;
|
||||
if (instanceIcon.src !== blankImage) {
|
||||
try {
|
||||
image = resize(instanceIcon);
|
||||
} catch { }
|
||||
}
|
||||
callback(
|
||||
instanceName.value,
|
||||
instanceHost.value,
|
||||
instanceHostSecure.checked,
|
||||
instanceSoftware.value,
|
||||
instanceIcon.src == blankImage ? null : resize(instanceIcon)
|
||||
image
|
||||
);
|
||||
form.reset();
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue