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 for @yml being nil #270

Merged
merged 2 commits into from
Oct 31, 2016
Merged

Fix for @yml being nil #270

merged 2 commits into from
Oct 31, 2016

Conversation

Hatlen
Copy link
Contributor

@Hatlen Hatlen commented Jul 27, 2014

When there's no settings specified for the Rails.env that you are running, @yml will get the value nil. I got that error when running my tests and not specifying any settings for the test environment.

The rescue at the ending of line 114 in config.rb looked a little suspicious, the value incase of an exception would always have been {} and that rescue case would catch all exceptions, making the "rescue Psych::SyntaxError useless."

So maybe this solution is more inline with the intention of the writer, if the YAML.load... is nil set it to {}.

When there's no settings specified for the Rails.env that you are running, @yml will get the value nil. I got that error when running my tests and not specifying any settings for the test environment.

The rescue at the ending of line 114 looked a little suspicious, the value incase of an exception would always have been {} and that rescue case would catch all exceptions, making the "rescue Psych::SyntaxError useless."

So maybe this solution is more inline with the intention of the writer, if the YAML.load... is nil set it to {}.
@PikachuEXE
Copy link
Member

Sorry, I should merge this eariler

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.

2 participants