Skip to content

Commit

Permalink
Fix adding transaction to an empty file (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
chvp authored Dec 30, 2023
1 parent 5126bf5 commit 099cef6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class LedgerRepository
context.contentResolver.openOutputStream(fileUri, "wa")
?.let { OutputStreamWriter(it) }
?.use {
if (fileContents.value!!.last() != "") {
if (!fileContents.value!!.isEmpty() && fileContents.value!!.last() != "") {
it.write("\n")
}
it.write(text)
Expand Down

0 comments on commit 099cef6

Please sign in to comment.