shared address parse fix

This commit is contained in:
julian 2023-01-13 16:11:34 -06:00
parent 40af5e5206
commit c08c3f779d

View file

@ -56,16 +56,18 @@ mixin WalletDB {
} }
if (data.item4 != null) { if (data.item4 != null) {
// check if address exists in db and add if it does not final address = await isar.addresses
if (await isar.addresses
.where() .where()
.valueEqualTo(data.item4!.value) .valueEqualTo(data.item4!.value)
.findFirst() == .findFirst();
null) {
// check if address exists in db and add if it does not
if (address == null) {
await isar.addresses.put(data.item4!); await isar.addresses.put(data.item4!);
} }
// link and save address // link and save address
tx.address.value = data.item4; tx.address.value = address ?? data.item4!;
await tx.address.save(); await tx.address.save();
} }
} }