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

View file

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