fix(signals_manager): ensure `savedAddresses` event has `JNull` check

There's something off with the `savedAddresses` signal data, which
causes it to be `JNull` instead of an empty array (`JArray`) and breaks
signal decoding.

Ultimately this should be fixed in status-go, but this unblocks Desktop.
This commit is contained in:
Pascal Precht 2022-10-13 13:13:28 +02:00 committed by Stefan Dunca
parent f0e238dce6
commit 013e226c66
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ proc fromEvent*(T: type MessageSignal, event: JsonNode): MessageSignal =
for jsonVerificationRequest in event["event"]["verificationRequests"]:
signal.verificationRequests.add(jsonVerificationRequest.toVerificationRequest())
if event["event"]{"savedAddresses"} != nil:
if event["event"]{"savedAddresses"} != nil and event["event"]{"savedAddresses"}.kind != JNull:
for jsonSavedAddress in event["event"]["savedAddresses"]:
signal.savedAddresses.add(jsonSavedAddress.toSavedAddressDto())