Fix error when breadcrumb image fails to load (#609)

This commit is contained in:
Michael Telatynski 2023-04-05 11:56:12 +01:00 committed by GitHub
parent 224bccaf95
commit 8b16f2d0d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,7 +220,8 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
return resp.arrayBuffer();
})
.then((arrayBuffer) => {
const buffer = Buffer.from(arrayBuffer!);
if (!arrayBuffer) return;
const buffer = Buffer.from(arrayBuffer);
button.icon = nativeImage.createFromBuffer(buffer);
button.label = "";
button.backgroundColor = "";