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

rake bugsnag:heroku:add_deploy_hook fails on empty env vars #261

Closed
joelcogen opened this issue Nov 26, 2015 · 1 comment
Closed

rake bugsnag:heroku:add_deploy_hook fails on empty env vars #261

joelcogen opened this issue Nov 26, 2015 · 1 comment

Comments

@joelcogen
Copy link

If you have an empty env var, it will output like this in heroku config:

MY_VAR=

(reproduce with heroku config:set MY_VAR=).

lib/bugsnag/tasks/bugsnag.rake:51 does this:

k,v = c.split("=")
obj[k] = v.strip.empty? ? nil : v

but the result of split in this case is ["MY_VAR"], so v is nil, and strip isn't defined on nil.

Maybe add:

next if v.nil?

between the two lines, or change the test to

obj[k] = (v.nil? || v.strip.empty?) ? nil : v
@kattrali
Copy link
Contributor

Thanks for the report @joelcogen. Just pushed a fix, and will make a release soon.

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