From 84e4cfc6bbfa7251dc8e2b88ca4c507b98cadc61 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 30 May 2013 09:46:02 +0300 Subject: [PATCH] Prevent mailer error when note with code highlight --- app/helpers/application_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 65d03fe0c..4c0bbf813 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -124,6 +124,9 @@ module ApplicationHelper end def user_color_scheme_class + # in case we dont have current_user (ex. in mailer) + return 1 unless defined?(current_user) + case current_user.color_scheme_id when 1 then 'white' when 2 then 'black' -- 2.11.0