]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedLedgerTransaction.java
fix sending empty transaction comments as "", not as null
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / json / v1_14 / ParsedLedgerTransaction.java
index eec404b8326c32216aa8f73d3cfbea4694756ea5..6c8841595e15989922ff6b74beafef2c598f6775 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
@@ -48,7 +48,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<>();