[Fix] GroupedParameterizedElement.getRelationId/s() handles missing param

This commit is contained in:
Robert von Burg 2021-01-13 15:23:29 +01:00
parent ab17f4a487
commit 6f8274f631
1 changed files with 8 additions and 2 deletions

View File

@ -709,12 +709,18 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
@Override
public String getRelationId(String paramKey) throws StrolchModelException {
return getRelationParam(paramKey, true).getValue();
ParameterBag relationsBag = getParameterBag(BAG_RELATIONS, false);
if (relationsBag == null)
return "";
return relationsBag.getString(paramKey);
}
@Override
public List<String> getRelationIds(String paramKey) throws StrolchModelException {
return getRelationsParam(paramKey, true).getValue();
ParameterBag relationsBag = getParameterBag(BAG_RELATIONS, false);
if (relationsBag == null)
return List.of();
return relationsBag.getStringList(paramKey);
}
@Override