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

Fix mimetype returning nil #14356

Merged
merged 1 commit into from
Jul 19, 2020

Conversation

noellabo
Copy link
Contributor

Replace nil with '' for the occasional return of nil.

@Gargron
Copy link
Member

Gargron commented Jul 19, 2020

What is the bug this solves? As far as I can tell the value is not saved anywhere, and for comparison with other arrays, there is no difference between nil and ''...

@noellabo
Copy link
Contributor Author

https://github.com/tootsuite/mastodon/blob/8141d92cd4047b1a2c4be96bb5b4c23dc137dc95/lib/paperclip/media_type_spoof_detector_extensions.rb#L10

NoMethodError: undefined method `split' for nil:NilClass

&.split is another way.

The conditions under which MimeMagic.by_magic(file) returns nil are not well understood.

@Gargron Gargron merged commit 101485a into mastodon:master Jul 19, 2020
shouo1987 pushed a commit to CrossGate-Pawoo/mastodon that referenced this pull request Dec 7, 2022
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.

None yet

2 participants