Skip to content

Commit

Permalink
fix(model-server-lib): don't throw exceptions for missing children
Browse files Browse the repository at this point in the history
Restore the old behavior of allow to query non-existing children similar
to what has been done in MODELIX-435 for references.

Fixes: MODELIX-444
  • Loading branch information
languitar committed May 24, 2023
1 parent e8121db commit 92bc3eb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ fun RootOrSubquery.queryNodes(node: INode): Sequence<INode> {
return when (this) {
is QueryAllChildren -> node.allChildren.asSequence()
is QueryAncestors -> node.getAncestors(false)
is QueryChildren -> node.getChildren(this.role).asSequence()
is QueryChildren -> try {
node.getChildren(this.role).asSequence()
} catch (e: RuntimeException) {
emptySequence()
}
is QueryDescendants -> node.getDescendants(false)
is QueryParent -> listOfNotNull(node.parent).asSequence()
is QueryReference -> {
Expand Down

0 comments on commit 92bc3eb

Please sign in to comment.