diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 8b17b7efc..260120d5d 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -4,7 +4,7 @@ module UsersHelper end def has_unread_dmails?(user) - user.unread_dmail_count > 0 && (cookies[:hide_dmail_notice].to_i < latest_unread_dmail(user).id) + user.unread_dmail_count > 0 && latest_unread_dmail(user).present? && (cookies[:hide_dmail_notice].to_i < latest_unread_dmail(user).id) end def latest_unread_dmail(user)