From 4e47dc5926b546e5575eb4d646a4a5c3821ce389 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Fri, 12 Jan 2024 19:40:26 +0100 Subject: [PATCH] fix: crash preventing user to ever recover wallet --- .../com/reactnativeldk/classes/LdkChannelManagerPersister.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/android/src/main/java/com/reactnativeldk/classes/LdkChannelManagerPersister.kt b/lib/android/src/main/java/com/reactnativeldk/classes/LdkChannelManagerPersister.kt index e0ff34b5..9dcf1a6b 100644 --- a/lib/android/src/main/java/com/reactnativeldk/classes/LdkChannelManagerPersister.kt +++ b/lib/android/src/main/java/com/reactnativeldk/classes/LdkChannelManagerPersister.kt @@ -85,7 +85,7 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler { body.putHexString("payment_id", (paymentPathFailed.payment_id as Option_ThirtyTwoBytesZ.Some).some) body.putHexString("payment_hash", paymentPathFailed.payment_hash) body.putBoolean("payment_failed_permanently", paymentPathFailed.payment_failed_permanently) - body.putInt("short_channel_id", (paymentPathFailed.short_channel_id as Option_u64Z.Some).some.toInt()) + body.putInt("short_channel_id", (paymentPathFailed.short_channel_id as? Option_u64Z.Some)?.some?.toInt() ?: 0) // val path = Arguments.createArray() // paymentPathFailed.path.iterator().forEach { path.pushMap(it.asJson) } // body.putArray("path_hops", path)