Check if project before calling count on issuable.

This commit is contained in:
Marin Jankovski 2015-04-20 10:21:15 +02:00
parent 6977810360
commit 219cbf3927
1 changed files with 3 additions and 1 deletions

View File

@ -323,7 +323,9 @@ module ApplicationHelper
entity_title = entity.to_s.humanize
count =
if current_controller?(:issues)
if project.nil?
""
elsif current_controller?(:issues)
" (#{project.issues.send(entity).count})"
elsif current_controller?(:merge_requests)
" (#{project.merge_requests.send(entity).count})"