diff options
author | Arne Schwabe <arne@rfc2549.org> | 2021-10-07 15:39:28 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2021-10-07 15:39:28 +0200 |
commit | 881d82ebd5cdd5588ef41cb1cacacb27988f61a6 (patch) | |
tree | fc2d90b725de244e340f20f27e7f6b2e94784e46 /main/src/ui | |
parent | 706f3d28ab839369d0036299c4ee77d12b776a9a (diff) |
Fix two small issues reported in crashes from Play Console
Diffstat (limited to 'main/src/ui')
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt index 73a3f75e..725f466c 100644 --- a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt +++ b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt @@ -12,6 +12,7 @@ import android.app.AlertDialog import android.content.ActivityNotFoundException import android.content.Intent import android.content.pm.PackageManager +import android.database.Cursor import android.net.Uri import android.os.AsyncTask import android.os.Build @@ -650,9 +651,9 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener mPathsegments = data.pathSegments - val cursor = contentResolver.query(data, null, null, null, null) - + var cursor:Cursor? = null try { + cursor = contentResolver.query(data, null, null, null, null) if (cursor != null && cursor.moveToFirst()) { var columnIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME) @@ -667,6 +668,9 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener log("Mime type: " + cursor.getString(columnIndex)) } } + } + catch (se:SecurityException) { + log("Importing failed: ${se.localizedMessage}") } finally { cursor?.close() } |