Skip to content

Fix error when deleting content with an empty file or image field - #104

Merged
robgietema merged 1 commit into
mainfrom
fix-delete-empty-file-fields
Nov 18, 2026
Merged

robgietema merged 1 commit into
mainfrom
fix-delete-empty-file-fields

Conversation

@robgietema

Copy link
Copy Markdown
Member

Deleting a content item whose type has a File or Image field that is empty (no value in one or more versions) failed with:

TypeError: Cannot read properties of undefined (reading 'uuid')

Document.deleteFilesAndImages read version.json[field].uuid (and the uuids of the image scales) without checking that the field has a value. Empty fields and missing scales are now skipped, and empty uuids are filtered out before the files are removed.

Includes a changelog entry.

@robgietema
robgietema merged commit 2447f0a into main Nov 18, 2026
10 checks passed
@robgietema
robgietema deleted the fix-delete-empty-file-fields branch November 18, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant