Skip to content
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

Handle null extensions and mimetypes with ImageGeneratorFactory #3326

Merged

Conversation

cosmastech
Copy link
Contributor

In our test suite @inflcr, some of our factories were lacking mime_types and filenames.

This causes and exception to be thrown when attempting to access the Media attribute accessor type() (because ImageGenerator@canHandleExtension() and ImageGenerator@canHandleMime() both require a string).

I have fixed that in this PR by exiting early in their respective factory methods when null is passed in.

@freekmurze freekmurze merged commit bac3280 into spatie:main Jul 27, 2023
@freekmurze
Copy link
Member

Thanks!

@cosmastech cosmastech deleted the fix/nullable-mimetype-and-extension branch July 27, 2023 10:21
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.

2 participants