summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-12-21 02:25:47 +0000
committerGo MAEDA <maeda@farend.jp>2022-12-21 02:25:47 +0000
commit361b285250c01b12d2063049c65b389b05056198 (patch)
treee0368c117dc9c7f28b8aaaf1b8ae11bd454c444a /app/models/project.rb
parent4edbefc4638726de41ff09053d539ee3b1e116cb (diff)
downloadredmine-361b285250c01b12d2063049c65b389b05056198.tar.gz
redmine-361b285250c01b12d2063049c65b389b05056198.zip
Do not break when setting enabled_module_names on a project without a default_member_role (#38064).
Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@21994 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 81ec37d10..0502ffca1 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -842,7 +842,7 @@ class Project < ActiveRecord::Base
if user.admin?
true
else
- default_member_role.has_permission?(:select_project_modules)
+ default_member_role&.has_permission?(:select_project_modules)
end
else
user.allowed_to?(:select_project_modules, project)