mirror of
https://github.com/DependencyTrack/dependency-track.git
synced 2025-10-19 16:03:19 +00:00
Added a default value for 'active' if it is null
When creating a project from json payload and the active field is not specified it will now default to true instead of null. This fixes an issue with projects not being assignable as parent projects because they are "inactive". Signed-off-by: Willie Nel <4620380+willienel@users.noreply.github.com>
This commit is contained in:
parent
016c3320e6
commit
7ead801fea
2 changed files with 18 additions and 0 deletions
|
@ -497,6 +497,9 @@ final class ProjectQueryManager extends QueryManager implements IQueryManager {
|
|||
if (project.getParent() != null && !Boolean.TRUE.equals(project.getParent().isActive())){
|
||||
throw new IllegalArgumentException("An inactive Parent cannot be selected as parent");
|
||||
}
|
||||
if (project.isActive() == null) {
|
||||
project.setActive(Boolean.TRUE);
|
||||
}
|
||||
final Project result = persist(project);
|
||||
final List<Tag> resolvedTags = resolveTags(tags);
|
||||
bind(project, resolvedTags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue