Skip to content

Bounty 389 undefined method banner #218

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 2 commits into from
Oct 9, 2014
Merged

Bounty 389 undefined method banner #218

merged 2 commits into from
Oct 9, 2014

Conversation

YaroSpace
Copy link
Contributor

Bug: https://assembly.com/coderwall/bounties/389#
Description: Some users a getting "undefined method banner for nil:NilClass" errors

Cause: when a use is not logged in, current_user returns nil, thus causing the NoMethodError when user.banner gets called from within location_image_url.

Fix: removed the else block, forcing to return nil when other conditions are not satisfied. Returning nil is safe, because the calling image_path returns '/assets' when a nil argument is passed.

just3ws added a commit that referenced this pull request Oct 9, 2014
@just3ws just3ws merged commit a82f623 into coderwall:master Oct 9, 2014
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