From 7c579bb2ed5235a2dc1af600013606ee689527dd Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 25 Apr 2021 19:29:35 +0300 Subject: [PATCH] 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 --- .../net/ktnx/mobileledger/model/LedgerTransactionAccount.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5