From 0ab984116284d343ccb23843b20b3c157f11f1af Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 23 Apr 2021 00:08:45 +0300 Subject: [PATCH] fix copying ensuring currency is not null --- .../java/net/ktnx/mobileledger/db/TransactionAccount.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/db/TransactionAccount.java b/app/src/main/java/net/ktnx/mobileledger/db/TransactionAccount.java index abcaa034..d6417cd6 100644 --- a/app/src/main/java/net/ktnx/mobileledger/db/TransactionAccount.java +++ b/app/src/main/java/net/ktnx/mobileledger/db/TransactionAccount.java @@ -24,6 +24,8 @@ import androidx.room.ForeignKey; import androidx.room.Index; import androidx.room.PrimaryKey; +import net.ktnx.mobileledger.utils.Misc; + @Entity(tableName = "transaction_accounts", foreignKeys = { @ForeignKey(entity = Transaction.class, parentColumns = {"id"}, childColumns = {"transaction_id"}, onDelete = ForeignKey.CASCADE, @@ -109,7 +111,7 @@ public class TransactionAccount { transactionId = o.transactionId; orderNo = o.orderNo; accountName = o.accountName; - currency = o.currency; + currency = Misc.nullIsEmpty(o.currency); amount = o.amount; comment = o.comment; generation = o.generation; -- 2.39.5