mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-28 02:34:10 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user