Skip to content

Return first css path when route index is nil #54

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

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

shinnc
Copy link
Contributor

@shinnc shinnc commented Aug 25, 2020

I was using CriticalPathCss.generate to generate dynamic routes that aren't defined in critical_path_css.yml, and hit with this error TypeError: no implicit conversion from nil to integer.

The reason is because routes.index(route) is nil, and you cannot call [nil] in an array, hence css_paths.first is never called. Let me know if .to_i works, since it might seems too magical for some people. On the other hand, please let me know if I'm using the .generate method incorrectly...

@michael-misshore michael-misshore merged commit f7c5089 into mudbugmedia:master Aug 27, 2020
@michael-misshore
Copy link
Contributor

Thanks for the contribution. I'll get this pushed out as soon as I can.

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.

3 participants