You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a minion function that can in some conditions return None.
When this happens, the Result element for the minion is a Result(null) -- in other words, The Result's xor is a Right, where the right value is null. Calling Result.result() causes a NullPointerException because Xor.Right.right() is returning Optional.of(right). Since it's returning an Optional, it seems like it'd be better to return Optional.ofNullable(right).
The same would probably apply to Xor.Left.left(), though I can't think of the use case where the value there would be null.
The text was updated successfully, but these errors were encountered:
I have a minion function that can in some conditions return
None
.When this happens, the Result element for the minion is a Result(null) -- in other words, The Result's xor is a Right, where the right value is null. Calling
Result.result()
causes a NullPointerException becauseXor.Right.right()
is returningOptional.of(right)
. Since it's returning an Optional, it seems like it'd be better to return Optional.ofNullable(right).The same would probably apply to Xor.Left.left(), though I can't think of the use case where the value there would be null.
The text was updated successfully, but these errors were encountered: