mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 18:29:52 +01:00
fixed an error when there's nothing in the inbox
This commit is contained in:
parent
4d35d96d1c
commit
aaf1fbf42b
1 changed files with 4 additions and 3 deletions
|
@ -41,8 +41,9 @@ module ApplicationHelper
|
|||
.where(user_id: current_user.id)
|
||||
.group(:user_id)
|
||||
.order(:count)
|
||||
.first.count
|
||||
return nil unless count > 0
|
||||
count
|
||||
.first
|
||||
return nil if count.nil?
|
||||
return nil unless count.count > 0
|
||||
count.count
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue