Skip to content

Commit

Permalink
Fix two small issues reported in crashes from Play Console
Browse files Browse the repository at this point in the history
  • Loading branch information
schwabe committed Oct 7, 2021
1 parent 706f3d2 commit 881d82e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ private void processProxyCMD(String argument) {
String proxyname = null;
boolean proxyUseAuth = false;

if (mProfile.mConnections != null && mProfile.mConnections.length > connectionEntryNumber) {
if (mProfile != null && mProfile.mConnections != null && mProfile.mConnections.length > connectionEntryNumber) {
Connection connection = mProfile.mConnections[connectionEntryNumber];
proxyType = connection.mProxyType;
proxyname = connection.mProxyName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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()
}
Expand Down

0 comments on commit 881d82e

Please sign in to comment.