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 `[]' for nil:NilClass" in media_info.rb:22 #35

Closed
christiangenco opened this issue Oct 3, 2017 · 2 comments

Comments

@christiangenco
Copy link

I'm having the hardest time tracking down a bug in using this library for save_url and save_url_check_job_status.

I can't recreate it, but while it's running in background jobs (with sidekiq), save_url_check_job_status will throw NoMethodError: undefined method '[]' for nil:NilClass tracing to media_info.rb:22:

tag = data['metadata']['.tag']

So sometimes when save_url_check_job_status is called, data['metadata'] is nil. Is this a problem with this library, or could it be that I'm calling it in a strange way?

@Jesus Jesus closed this as completed in 38092f4 Oct 3, 2017
@Jesus
Copy link
Owner

Jesus commented Oct 3, 2017

Hi,

thanks for reporting this. The issue has been fixed and I'll release a new gem version today.

It was difficult to track down because you had to catch it in the short lapse of time Dropbox needs to generate the media metadata.

The problem was that we were getting a pending tag as metadata when it hadn't been generated yet. This is specified in the documentation so it's a pity we missed it when we implemented this.

Here's the test that would catch this problem: https://github.com/Jesus/dropbox_api/blob/master/spec/metadata/file_spec.rb#L42-L55

@christiangenco
Copy link
Author

Bless you ❤️

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

No branches or pull requests

2 participants