diff options
author | Stan Hu <stanhu@gmail.com> | 2017-04-21 09:45:09 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-04-21 09:48:20 +0300 |
commit | 8a570944a9d0f0e4cd607e5d2dfe2eac4bd83f47 (patch) | |
tree | a50ac76dd0140d4072e3b04062998f4e928dad2a /app/models/issue.rb | |
parent | a9da37434af6d44c5f851affd4bd69b370760e8e (diff) |
Fix Error 500 when referencing issue with project in pending delete
Closes #31215
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index d39ae3a6c92..305fc01f041 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -199,7 +199,7 @@ class Issue < ActiveRecord::Base # Returns `true` if the current issue can be viewed by either a logged in User # or an anonymous user. def visible_to_user?(user = nil) - return false unless project.feature_available?(:issues, user) + return false unless project && project.feature_available?(:issues, user) user ? readable_by?(user) : publicly_visible? end |