Patch #38064
Avoid exception when adding a project without any givable roles defined
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Project settings | |||
Target version: | 4.2.10 |
Description
Project.default_member_role
might return nil
if there is no default member role and no givable role at all.
In the safe_attribute
definition of Project#enabled_module_names
, we use the method's return value without checking this. The attached patch fixes this by using the safe navigation operator there (introduced in Ruby 2.3.0) and denying changing of the modules if the user is not an admin.
Associated revisions
Do not break when setting enabled_module_names on a project without a default_member_role (#38064).
Patch by Holger Just.
History
#1
Updated by Go MAEDA about 1 month ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Target version changed from Candidate for next minor release to 4.2.10
Committed the patch. Thank you.