prevents writing empty text files
This commit is contained in:
parent
371c521a85
commit
54647b223c
1 changed files with 6 additions and 2 deletions
|
@ -438,8 +438,12 @@ object FileHelper {
|
||||||
|
|
||||||
/* Writes given text to file on storage */
|
/* Writes given text to file on storage */
|
||||||
private fun writeTextFile(text: String, fileUri: Uri) {
|
private fun writeTextFile(text: String, fileUri: Uri) {
|
||||||
|
if (text.isNotEmpty()) {
|
||||||
val file: File = fileUri.toFile()
|
val file: File = fileUri.toFile()
|
||||||
file.writeText(text)
|
file.writeText(text)
|
||||||
|
} else {
|
||||||
|
LogHelper.w(TAG, "Writing text file $fileUri failed. Empty text string text was provided.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue