Check for empty object (#8075)

## Summary

<!-- One sentence describing what changed and why. -->

## Changes
- **What**: <!-- Core functionality added/modified -->
PNG images causes getWorkflowDataFromFile() to return an empty object,
added a check to handle it.

## Review Focus
<!-- If this PR fixes an issue, uncomment and update the line below -->
<!-- Fixes #ISSUE_NUMBER -->
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)
This commit is contained in:
Brian Jemilo II
2026-01-17 00:03:54 -06:00
committed by GitHub
parent 851e8beb29
commit 94706b5b04

View File

@@ -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)