diff --git a/desktop/plugins/public/navigation/plugin.tsx b/desktop/plugins/public/navigation/plugin.tsx index 4412ee7f4..6551e37ab 100644 --- a/desktop/plugins/public/navigation/plugin.tsx +++ b/desktop/plugins/public/navigation/plugin.tsx @@ -74,6 +74,12 @@ export function plugin(client: PluginClient) { }); const screenshot: Buffer = await client.device.screenshot(); + if (screenshot.byteLength === 0) { + console.warn( + '[navigation] Could not retrieve valid screenshot from the device.', + ); + return; + } const blobURL = URL.createObjectURL(bufferToBlob(screenshot)); // this process is async, make sure we update the correct one.. const navigationEventIndex = navigationEvents