diff options
author | Go MAEDA <maeda@farend.jp> | 2024-09-10 00:55:32 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-09-10 00:55:32 +0000 |
commit | 68121841b5f830851912a09265998f8ee86fd31c (patch) | |
tree | 0c66e1c6915287a717bf512d2da73f131666e8dc /app | |
parent | e8879d891f39539fe1d0d6cb14c26a02944234a5 (diff) | |
download | redmine-68121841b5f830851912a09265998f8ee86fd31c.tar.gz redmine-68121841b5f830851912a09265998f8ee86fd31c.zip |
Fix NoMethodError in Issue#blocked? due to invalid issue_from_id in Issue#relations_from (#8539).
Patch by Go MAEDA (user:maeda).
git-svn-id: https://svn.redmine.org/redmine/trunk@23048 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-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 9b47ce7bd..3debf90ec 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1018,7 +1018,7 @@ class Issue < ApplicationRecord # Returns true if this issue is blocked by another issue that is still open def blocked? - !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil? + relations_to.any? {|ir| ir.relation_type == 'blocks' && ir.issue_from&.closed? == false} end # Returns true if this issue can be closed and if not, returns false and populates the reason |