From: Damyan Ivanov Date: Sun, 25 Apr 2021 16:29:35 +0000 (+0300) Subject: fix converting LedgerTransactionAccount to TransactionAccount (room) X-Git-Tag: v0.18.0~20 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=7c579bb2ed5235a2dc1af600013606ee689527dd;p=mobile-ledger.git fix converting LedgerTransactionAccount to TransactionAccount (room) the currency can't be null having null here led to problems when saving the transaction speculatively and account amounts are updated, because in the database account_values.currency is declared not null --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java index 53b6a65f..774112ac 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -129,7 +129,7 @@ public class LedgerTransactionAccount { if (amountSet) dbo.setAmount(amount); dbo.setComment(comment); - dbo.setCurrency(currency); + dbo.setCurrency(Misc.nullIsEmpty(currency)); dbo.setId(dbId); return dbo;