Skip to content

Commit

Permalink
Fix reference metadata bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgaldi committed May 17, 2024
1 parent 656c409 commit 6fc56b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public String toString() {
}

public void addVariable(VariableDef variable) {
addIfUnique(_categories, EntityChildUniquenessKey::fromVar, variable);
addIfUnique(_variables, EntityChildUniquenessKey::fromVar, variable);
}

public void addCategory(VariableDef category) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ private String getCollectionAttribute(Function<CollectionDef, ?> getter, Collect
}

private String getVariableAttribute(Function<VariableDef, ?> getter, VariableSpec var) {
return var == null ? "" : getter.apply(_metadata.getVariable(var).orElseThrow()).toString();
return var == null ? "" : getter.apply(_metadata.getVariable(var)
.orElseThrow(() -> new IllegalArgumentException(
String.format("Unable to find variable with spec %s, %s", var.getEntityId(), var.getVariableId())))).toString();
}

public String getCollectionType(CollectionSpec collection) {
Expand Down

0 comments on commit 6fc56b2

Please sign in to comment.