Skip to content

Fix TypeError when processing SVG images with undefined edits #605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chojs23
Copy link

@chojs23 chojs23 commented Aug 20, 2025

Issue #, if available:

#604

Description of changes:

When processing SVG images where imageRequestInfo.edits is undefined, the code was attempting to access edits.toFormat directly, causing a TypeError that crashed the lambda.

  • Fix TypeError when processing SVG images with undefined edits
  • Add optional chaining (?.) to safely access edits.toFormat property
  • Prevents "Cannot read properties of undefined (reading 'toFormat')" errors

Checklist

  • 👋 I have added unit tests for all code changes.
  • 👋 I have run the unit tests, and all unit tests have passed.
  • ⚠️ This pull request might incur a breaking change.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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