From b5078e314a97ce66bf2e712a66c24d87b7722d60 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 25 Jun 2024 02:09:40 +0000 Subject: [PATCH] Creating a new issue fails with an internal error if no issue priorities are defined (#40860). Patch by Holger Just (@hjust). git-svn-id: https://svn.redmine.org/redmine/trunk@22895 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 95e5a4f24..65dd90027 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -2077,7 +2077,7 @@ class Issue < ApplicationRecord tracker.disabled_core_fields.each do |attribute| send :"#{attribute}=", nil end - self.priority_id ||= IssuePriority.default&.id || IssuePriority.active.first.id + self.priority_id ||= IssuePriority.default&.id || IssuePriority.active.first&.id self.done_ratio ||= 0 end end