From: Damyan Ivanov Date: Thu, 22 Apr 2021 21:08:45 +0000 (+0300) Subject: fix copying ensuring currency is not null X-Git-Tag: v0.18.0~48 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=0ab984116284d343ccb23843b20b3c157f11f1af;p=mobile-ledger.git fix copying ensuring currency is not null --- 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;