Skip to content

Commit

Permalink
spacemanager: Fix NPE in listing space reservations
Browse files Browse the repository at this point in the history
Reservations without an owner would trigger an NPE.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.11
Request: 2.10
Request: 2.9
Request: 2.8
Acked-by: Karsten Schwank <karsten.schwank@desy.de>
Patch: https://rb.dcache.org/r/7846/
  • Loading branch information
gbehrmann committed Feb 23, 2015
1 parent ee39ee1 commit c275812
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ private SpaceManagerDatabase.SpaceCriterion spacesWhereOptionsMatch()

private String toOwner(String voGroup, String voRole)
{
if (voGroup.charAt(0) != '/' || voRole == null || voRole.equals("*")) {
if (voGroup == null) {
return null;
} else if (voGroup.charAt(0) != '/' || voRole == null || voRole.equals("*")) {
return voGroup;
} else {
return voGroup + "/Role=" + voRole;
Expand Down Expand Up @@ -645,8 +647,8 @@ private SpaceManagerDatabase.FileCriterion filesWhereOptionsMatch()
}

@Command(name = "reserve space", hint = "create space reservation",
description = "A space reservation has a size, an access latency, a retention policy, " +
"and an owner. It may have a description, and a lifetime. If the lifetime " +
description = "A space reservation has a size, an access latency, and a retention policy. " +
"It may have a description, a lifetime, and an owner. If the lifetime " +
"is exceeded, the reservation expires and the files in it are released. " +
"The owner is only used to authorize creation of the reservation in the " +
"link group, and to authorize the release of the reservation - it is " +
Expand Down

0 comments on commit c275812

Please sign in to comment.