Skip to content

Commit

Permalink
Remove unwrap of reason optional
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei <[email protected]>
  • Loading branch information
danielgranhao and andrei-21 committed Jun 28, 2023
1 parent 6862ab8 commit 2c31458
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eel/src/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ impl EventHandler for LipaEventHandler {
.unwrap()
.outgoing_payment_failed(
&payment_hash,
PayErrorCode::from_failure_reason(reason.unwrap()), // `reason` could only be None if we deserialize events from old LDK versions
PayErrorCode::from_failure_reason(
reason.unwrap_or(
lightning::events::PaymentFailureReason::UnexpectedError,
),
), // `reason` could only be None if we deserialize events from old LDK versions
)
.is_err()
{
Expand Down

0 comments on commit 2c31458

Please sign in to comment.