From f8b2edba7eca0d319397582dc44508ae5e7b3c79 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Oct 2017 10:49:43 +0100 Subject: [PATCH] add a null check at ReadTextActivity --- .../filemanager/activities/ReadTextActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt index 4a532272..b6267b52 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt @@ -65,6 +65,11 @@ class ReadTextActivity : SimpleActivity() { private fun checkIntent() { read_text_view.setTextColor(config.textColor) val uri = intent.data + if (uri == null) { + finish() + return + } + val text = if (uri.scheme == "file") { filePath = uri.path File(uri.path).readText()