Commit d5850f9c authored by Mygod's avatar Mygod

Fix FileNotFoundException crash

parent 33e5d4dd
......@@ -130,7 +130,7 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() {
try {
// we read and persist all its content here to avoid content URL permission issues
hosts.text = activity.contentResolver.openInputStream(data!!.data!!)!!.bufferedReader().readText()
} catch (e: RuntimeException) {
} catch (e: Exception) {
activity.snackbar(e.readableMessage).show()
}
}
......
......@@ -325,7 +325,7 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
try {
// we read and persist all its content here to avoid content URL permission issues
hosts.text = context.contentResolver.openInputStream(data!!.data!!)!!.bufferedReader().readText()
} catch (e: RuntimeException) {
} catch (e: Exception) {
Toast.makeText(context, e.readableMessage, Toast.LENGTH_SHORT).show()
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment