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

images.best sometimes fails with undefined method `start_with?' for nil:NilClass (NoMethodError) #359

Open
Aqualon opened this issue Apr 5, 2023 · 2 comments

Comments

@Aqualon
Copy link

Aqualon commented Apr 5, 2023

m = MetaInspector.new('https://karriere.westfalen.com/job/M%C3%BCnster-HR-Business-Partner-(mwd)/920832901/')
m.images.best

raises

/gems/fastimage-2.2.6/lib/fastimage.rb:235:in `initialize': undefined method `start_with?' for nil:NilClass (NoMethodError)

This happens in https://github.com/metainspector/metainspector/blob/35e3e75875ecbbb56fb7b0a5c17adc69baed1cb3/lib/meta_inspector/parsers/images.rb#L44-L47 because MetaInspector passes a nil URL to FastImage.size. The imgs_with_size variable looks like this for the failing URL.

[["https://rmkcdn.successfactors.com/241be56e/a93393ca-2eac-4e3c-b06e-e.png", nil, nil], [nil, nil, nil]]
@Aqualon
Copy link
Author

Aqualon commented Apr 5, 2023

Figure out, that this is a changed behavior in fastimage 2.2.2 onwards.

@jaimeiniesta
Copy link
Owner

Thanks for the bug report @Aqualon !

I'll have a look when I find some time, feel free to send a PR to fix that if you feel so inclined :)

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