Skip to content

Commit 881d82e

Browse files
committed
Fix two small issues reported in crashes from Play Console
1 parent 706f3d2 commit 881d82e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ private void processProxyCMD(String argument) {
453453
String proxyname = null;
454454
boolean proxyUseAuth = false;
455455

456-
if (mProfile.mConnections != null && mProfile.mConnections.length > connectionEntryNumber) {
456+
if (mProfile != null && mProfile.mConnections != null && mProfile.mConnections.length > connectionEntryNumber) {
457457
Connection connection = mProfile.mConnections[connectionEntryNumber];
458458
proxyType = connection.mProxyType;
459459
proxyname = connection.mProxyName;

main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import android.app.AlertDialog
1212
import android.content.ActivityNotFoundException
1313
import android.content.Intent
1414
import android.content.pm.PackageManager
15+
import android.database.Cursor
1516
import android.net.Uri
1617
import android.os.AsyncTask
1718
import android.os.Build
@@ -650,9 +651,9 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener
650651

651652
mPathsegments = data.pathSegments
652653

653-
val cursor = contentResolver.query(data, null, null, null, null)
654-
654+
var cursor:Cursor? = null
655655
try {
656+
cursor = contentResolver.query(data, null, null, null, null)
656657

657658
if (cursor != null && cursor.moveToFirst()) {
658659
var columnIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)
@@ -667,6 +668,9 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener
667668
log("Mime type: " + cursor.getString(columnIndex))
668669
}
669670
}
671+
}
672+
catch (se:SecurityException) {
673+
log("Importing failed: ${se.localizedMessage}")
670674
} finally {
671675
cursor?.close()
672676
}

0 commit comments

Comments
 (0)