add a null check at ReadTextActivity

This commit is contained in:
tibbi 2017-10-29 10:49:43 +01:00
parent 3c88cbfbee
commit f8b2edba7e

View file

@ -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()