Skip to content

Commit dfcf42a

Browse files
authored
Merge pull request #116 from modelix/bugfix/MODELIX-444-handle-resolving-non-existing-children
fix(model-server-lib): don't throw exceptions for missing children
2 parents e8121db + 92bc3eb commit dfcf42a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

model-server-lib/src/main/kotlin/org/modelix/model/server/light/QueryImplementation.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ fun RootOrSubquery.queryNodes(node: INode): Sequence<INode> {
4747
return when (this) {
4848
is QueryAllChildren -> node.allChildren.asSequence()
4949
is QueryAncestors -> node.getAncestors(false)
50-
is QueryChildren -> node.getChildren(this.role).asSequence()
50+
is QueryChildren -> try {
51+
node.getChildren(this.role).asSequence()
52+
} catch (e: RuntimeException) {
53+
emptySequence()
54+
}
5155
is QueryDescendants -> node.getDescendants(false)
5256
is QueryParent -> listOfNotNull(node.parent).asSequence()
5357
is QueryReference -> {

0 commit comments

Comments
 (0)