diff --git a/app/controllers/projects/base_controller.rb b/app/controllers/projects/base_controller.rb index 659a920dd..41bf3b8d9 100644 --- a/app/controllers/projects/base_controller.rb +++ b/app/controllers/projects/base_controller.rb @@ -10,7 +10,9 @@ class Projects::BaseController < ApplicationController end def init_statistics - @opened_issues_count = @project.issues.without_pull_requests.not_closed_or_merged.count - @opened_pull_requests_count = @project.issues.joins(:pull_request).not_closed_or_merged.count + if @project + @opened_issues_count = @project.issues.without_pull_requests.not_closed_or_merged.count + @opened_pull_requests_count = @project.issues.joins(:pull_request).not_closed_or_merged.count + end end end