mirror of
https://github.com/corda/corda.git
synced 2024-12-21 13:57:54 +00:00
core: Fix ErrorOr.combine
This commit is contained in:
parent
9d7bfe4229
commit
cae9b758ff
@ -317,7 +317,7 @@ data class ErrorOr<out A> private constructor(val value: A?, val error: Throwabl
|
||||
// Applicative
|
||||
fun <B, C> combine(other: ErrorOr<B>, function: (A, B) -> C): ErrorOr<C> {
|
||||
val newError = error ?: other.error
|
||||
return ErrorOr(if (newError == null) null else function(value as A, other.value as B), newError)
|
||||
return ErrorOr(if (newError != null) null else function(value as A, other.value as B), newError)
|
||||
}
|
||||
|
||||
// Monad
|
||||
|
Loading…
Reference in New Issue
Block a user