Skip to content

Commit 260da45

Browse files
committed
catch Out Of Memory errors at opening files in the editor
1 parent 22b331e commit 260da45

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/ReadTextActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ class ReadTextActivity : SimpleActivity() {
204204
} else {
205205
try {
206206
contentResolver.openInputStream(uri)!!.bufferedReader().use { it.readText() }
207+
} catch (e: OutOfMemoryError) {
208+
showErrorToast(e.toString())
209+
return@ensureBackgroundThread
207210
} catch (e: Exception) {
208211
showErrorToast(e)
209212
finish()

0 commit comments

Comments
 (0)