Skip to content

Commit

Permalink
fix(modelql): fix serialization of nullMono
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuster23 committed Jan 3, 2024
1 parent 9854f63 commit 97971e5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ object TypedModelQL {
return input.map { referenceOrNull(it, link) }
}

@Suppress("UNCHECKED_CAST")
fun <SourceT : ITypedNode, TargetT : ITypedNode> setReference(input: IMonoStep<SourceT>, link: ITypedReferenceLink<TargetT>, target: IMonoStep<TargetT?>?): IMonoStep<SourceT> {
val targetOrNull = target?.untyped() ?: nullMono<INode>()
val targetOrNull = target?.untyped() ?: nullMono<String>() as IMonoStep<INode?> // cast is necessary since nullMono<INode> cannot be serialized
input.untyped().setReference(link.untyped(), targetOrNull)
return input
}
Expand Down

0 comments on commit 97971e5

Please sign in to comment.