add a null check at ReadTextActivity
This commit is contained in:
parent
3c88cbfbee
commit
f8b2edba7e
1 changed files with 5 additions and 0 deletions
|
@ -65,6 +65,11 @@ class ReadTextActivity : SimpleActivity() {
|
||||||
private fun checkIntent() {
|
private fun checkIntent() {
|
||||||
read_text_view.setTextColor(config.textColor)
|
read_text_view.setTextColor(config.textColor)
|
||||||
val uri = intent.data
|
val uri = intent.data
|
||||||
|
if (uri == null) {
|
||||||
|
finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val text = if (uri.scheme == "file") {
|
val text = if (uri.scheme == "file") {
|
||||||
filePath = uri.path
|
filePath = uri.path
|
||||||
File(uri.path).readText()
|
File(uri.path).readText()
|
||||||
|
|
Loading…
Reference in a new issue