Skip to content

Commit

Permalink
Merge pull request #160 from cristal-ise/Issue159_NPE_in_JooqItemHand…
Browse files Browse the repository at this point in the history
…ler_getItemPath

#159 Fix NPE in JooqItemHandler.getItemPath
  • Loading branch information
kovax committed Mar 22, 2019
2 parents aed27ae + dc86e46 commit 9b61244
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,18 @@ public static ItemPath getItemPath(DSLContext context, JooqItemPropertyHandler p
if(isAgent) {
String name;

if (record.field(nameProp) != null) name = record.get(nameProp, String.class);
else name = ((Property)properties.fetch(context, uuid, nameProp)).getValue();

if (record.field(nameProp) != null) {
name = record.get(nameProp, String.class);
} else {
Property nameProperty = (Property) properties.fetch(context, uuid, nameProp);
if (nameProperty == null) {
return null;
}
name = nameProperty.getValue();
}
if (name == null) {
return null;
}
return new AgentPath(uuid, ior, name, isTempPwd != null ? isTempPwd : false);
}
else
Expand Down

0 comments on commit 9b61244

Please sign in to comment.