adding a null check at ReadTextActivity

This commit is contained in:
tibbi 2018-02-21 21:35:04 +01:00
parent 10a3187cad
commit eebd4c80d0

View File

@ -67,8 +67,8 @@ class ReadTextActivity : SimpleActivity() {
private fun checkIntent() {
read_text_view.setTextColor(config.textColor)
val uri = if (intent.extras.containsKey(REAL_FILE_PATH)) {
Uri.fromFile(File(intent.extras.get(REAL_FILE_PATH).toString()))
val uri = if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
Uri.fromFile(File(intent.extras?.get(REAL_FILE_PATH).toString()))
} else {
intent.data
}