From 94706b5b046c7a892a927c8706ec55409d022a16 Mon Sep 17 00:00:00 2001 From: Brian Jemilo II Date: Sat, 17 Jan 2026 00:03:54 -0600 Subject: [PATCH] Check for empty object (#8075) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary ## Changes - **What**: PNG images causes getWorkflowDataFromFile() to return an empty object, added a check to handle it. ## Review Focus I don't think it exists yet? From Slack Conversation. Just make sure to use a PNG image and not a JPEG disguised as a PNG. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8075-Check-for-empty-object-2e96d73d3650816b8812eb7244b48f1a) by [Unito](https://www.unito.io) --- src/scripts/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 258214dd6e..a9427f85bf 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1433,7 +1433,7 @@ export class ComfyApp { async handleFile(file: File, openSource?: WorkflowOpenSource) { const fileName = file.name.replace(/\.\w+$/, '') // Strip file extension const workflowData = await getWorkflowDataFromFile(file) - if (!workflowData) { + if (_.isEmpty(workflowData)) { if (file.type.startsWith('image')) { const transfer = new DataTransfer() transfer.items.add(file)