Skip to content

Commit 2e47287

Browse files
author
Jan Guegel
committed
fix catch filePath.isEmpty() by opening SaveAs Dialog
Signed-off-by: Jan Guegel <[email protected]>
1 parent d7dd0d4 commit 2e47287

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/kotlin/org/fossify/filemanager/activities/ReadTextActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ class ReadTextActivity : SimpleActivity() {
209209
private fun saveText(shouldExitAfterSaving: Boolean = false) {
210210
updateFilePath()
211211

212-
if (hasStoragePermission()) {
212+
if (filePath.isEmpty()) {
213+
saveAsText(shouldExitAfterSaving)
214+
} else if (hasStoragePermission()) {
213215
val file = File(filePath)
214216
getFileOutputStream(file.toFileDirItem(this), true) {
215217
saveTextContent(it, shouldExitAfterSaving, true)

0 commit comments

Comments
 (0)