Skip to content

Commit c7ae139

Browse files
committed
adding some crashfixes
1 parent 8ab1ae6 commit c7ae139

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,12 @@ class ReadTextActivity : SimpleActivity() {
231231
filePath = uri.path!!
232232
val file = File(filePath)
233233
if (file.exists()) {
234-
file.readText()
234+
try {
235+
file.readText()
236+
} catch (e: Exception) {
237+
showErrorToast(e)
238+
""
239+
}
235240
} else {
236241
toast(R.string.unknown_error_occurred)
237242
""

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import android.util.AttributeSet
1111
import androidx.appcompat.app.AppCompatActivity
1212
import com.simplemobiletools.commons.extensions.*
1313
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
14+
import com.simplemobiletools.commons.helpers.isOreoPlus
1415
import com.simplemobiletools.filemanager.pro.R
1516
import com.simplemobiletools.filemanager.pro.activities.MimeTypesActivity
1617
import com.simplemobiletools.filemanager.pro.activities.SimpleActivity
@@ -86,6 +87,10 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
8687
}
8788

8889
private fun getSizes() {
90+
if (!isOreoPlus()) {
91+
return
92+
}
93+
8994
ensureBackgroundThread {
9095
getMainStorageStats(context)
9196

0 commit comments

Comments
 (0)