Commit 84e4cfc6bbfa7251dc8e2b88ca4c507b98cadc61
1 parent
abea7125
Exists in
master
and in
4 other branches
Prevent mailer error when note with code highlight
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -124,6 +124,9 @@ module ApplicationHelper | @@ -124,6 +124,9 @@ module ApplicationHelper | ||
124 | end | 124 | end |
125 | 125 | ||
126 | def user_color_scheme_class | 126 | def user_color_scheme_class |
127 | + # in case we dont have current_user (ex. in mailer) | ||
128 | + return 1 unless defined?(current_user) | ||
129 | + | ||
127 | case current_user.color_scheme_id | 130 | case current_user.color_scheme_id |
128 | when 1 then 'white' | 131 | when 1 then 'white' |
129 | when 2 then 'black' | 132 | when 2 then 'black' |