Skip to content

Commit

Permalink
Merge pull request #116 from modelix/bugfix/MODELIX-444-handle-resolv…
Browse files Browse the repository at this point in the history
…ing-non-existing-children

fix(model-server-lib): don't throw exceptions for missing children
  • Loading branch information
languitar authored May 24, 2023
2 parents e8121db + 92bc3eb commit dfcf42a
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 dfcf42a

Please sign in to comment.