]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix copying ensuring currency is not null
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:08:45 +0000 (00:08 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:08:45 +0000 (00:08 +0300)
app/src/main/java/net/ktnx/mobileledger/db/TransactionAccount.java

index abcaa0343522a23bb839a0f1a87a2a5ef458f6a3..d6417cd651336c43455c2637a14d5623969a9527 100644 (file)
@@ -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;