Project

General

Profile

Actions

Defect #38064

closed

Avoid exception when adding a project without any givable roles defined

Added by Holger Just over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Project settings
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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.


Files

Actions

Also available in: Atom PDF