[Fix] Handle null param in AbstractTransaction.getResourceByRelation() and .getResourcesByRelation()
This commit is contained in:
parent
0481ecc90d
commit
a389cc60f1
|
@ -905,6 +905,8 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
DBC.PRE.assertNotNull("element", element);
|
DBC.PRE.assertNotNull("element", element);
|
||||||
DBC.PRE.assertNotEmpty("refId", refId);
|
DBC.PRE.assertNotEmpty("refId", refId);
|
||||||
StringParameter refP = element.getParameter(BAG_RELATIONS, refId, assertExists);
|
StringParameter refP = element.getParameter(BAG_RELATIONS, refId, assertExists);
|
||||||
|
if (!assertExists && refP == null)
|
||||||
|
return null;
|
||||||
return getResourceBy(refP, assertExists);
|
return getResourceBy(refP, assertExists);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -924,6 +926,8 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
DBC.PRE.assertNotNull("element", element);
|
DBC.PRE.assertNotNull("element", element);
|
||||||
DBC.PRE.assertNotEmpty("refId", refId);
|
DBC.PRE.assertNotEmpty("refId", refId);
|
||||||
StringListParameter refsP = element.getParameter(BAG_RELATIONS, refId, assertExists);
|
StringListParameter refsP = element.getParameter(BAG_RELATIONS, refId, assertExists);
|
||||||
|
if (!assertExists && refsP == null)
|
||||||
|
return null;
|
||||||
return getResourcesBy(refsP, assertExists);
|
return getResourcesBy(refsP, assertExists);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue