Skip to content

Commit 8b8e2f0

Browse files
committed
chore(model-datastructure): throw NPE for consistency
1 parent 306474d commit 8b8e2f0

File tree

1 file changed

+2
-1
lines changed
  • model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy

1 file changed

+2
-1
lines changed

model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ class CLTree : ITree, IBulkTree {
257257
}
258258

259259
override fun setConcept(nodeId: Long, concept: IConceptReference?): ITree {
260-
val node = checkNotNull(resolveElement(nodeId)) { "nodeId could not be resolved. id=$nodeId" }
260+
// manually throw NullPointerException for consistency, should be replaced for all methods in the future.
261+
val node = resolveElement(nodeId) ?: throw NullPointerException("nodeId could not be resolved. id=$nodeId")
261262
val newData = create(
262263
node.id,
263264
concept?.getUID(),

0 commit comments

Comments
 (0)