]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/json/v1_19_1/ParsedLedgerTransaction.java
fix sending empty transaction comments as "", not as null
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / json / v1_19_1 / ParsedLedgerTransaction.java
index 74af2339b11f3fe9c848459ac63f2de73c9b8732..196408c79f9d331b43cd598e09ccda7b54c10104 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2020 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
@@ -46,7 +46,7 @@ public class ParsedLedgerTransaction implements net.ktnx.mobileledger.json.Parse
     }
     public static ParsedLedgerTransaction fromLedgerTransaction(LedgerTransaction tr) {
         ParsedLedgerTransaction result = new ParsedLedgerTransaction();
-        result.setTcomment(tr.getComment());
+        result.setTcomment(Misc.nullIsEmpty(tr.getComment()));
         result.setTprecedingcomment("");
 
         ArrayList<ParsedPosting> postings = new ArrayList<>();