The putOrRemove(key: String, event: Any?) signature loses type information. When JsonMapper.toJson() tries to serialize, it sees Any? and can't find the serializer for Nip47URI, causing:

SerializationException: Serializer for class 'Any' is not found
This commit is contained in:
davotoula
2025-10-06 12:50:13 +02:00
parent 6c72c36b9a
commit 341994e505

View File

@@ -325,7 +325,13 @@ object LocalPreferences {
PrefKeys.DEFAULT_DISCOVERY_FOLLOW_LIST, PrefKeys.DEFAULT_DISCOVERY_FOLLOW_LIST,
settings.defaultDiscoveryFollowList.value, settings.defaultDiscoveryFollowList.value,
) )
putOrRemove(PrefKeys.ZAP_PAYMENT_REQUEST_SERVER, settings.zapPaymentRequest.value?.denormalize())
val nwcToBeSaved = settings.zapPaymentRequest.value?.denormalize()
if (nwcToBeSaved != null) {
putString(PrefKeys.ZAP_PAYMENT_REQUEST_SERVER, JsonMapper.toJson(nwcToBeSaved))
} else {
remove(PrefKeys.ZAP_PAYMENT_REQUEST_SERVER)
}
putOrRemove(PrefKeys.LATEST_CONTACT_LIST, settings.backupContactList) putOrRemove(PrefKeys.LATEST_CONTACT_LIST, settings.backupContactList)