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

NoMethodError: undefined method `unpack1' for nil:NilClass #76

Closed
Baaboud opened this issue Dec 20, 2023 · 3 comments
Closed

NoMethodError: undefined method `unpack1' for nil:NilClass #76

Baaboud opened this issue Dec 20, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Baaboud
Copy link
Contributor

Baaboud commented Dec 20, 2023

we get this error when there is an empty file is uploaded in our application because the data part is blank
for example "data":"data:text/plain;base64,"

sometimes we are expecting empty files to be uploaded

I think we should consider allowing empty data part to be blank or adding validation to allow or prevent empty files

lib/active_storage_support/base64_attach.rb:22
decoded_data  = Base64.decode64(data || '')
@Baaboud Baaboud added the bug Something isn't working label Dec 20, 2023
@santib
Copy link
Member

santib commented Jan 3, 2024

Hi @Baaboud thanks for the report. Do you want to open a PR with the fix?

@Baaboud
Copy link
Contributor Author

Baaboud commented Jan 8, 2024

yes @santib I opened this PR for this issue
please check it when you have time

@santib
Copy link
Member

santib commented Jan 17, 2024

Fixed by #77

@santib santib closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants