diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java index 9dee3557..92356a20 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java @@ -527,22 +527,25 @@ public class ConfigConverter extends Activity implements FileSelectCallback { InputStream is = getContentResolver().openInputStream(data); mPathsegments = data.getPathSegments(); + Cursor cursor = null; + if (data!=null) + cursor = getContentResolver().query(data, null, null, null, null); + - Cursor cursor = getContentResolver().query(data, null, null, null, null); try { if (cursor!=null && cursor.moveToFirst()) { - int cidx = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); + int columnIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); - if (cidx != -1) { - String displayName = cursor.getString(cidx); + if (columnIndex != -1) { + String displayName = cursor.getString(columnIndex); if (displayName != null) possibleName = displayName; } - cidx = cursor.getColumnIndex("mime_type"); - if (cidx != -1) { - log("Opening Mime TYPE: " + cursor.getString(cidx)); + columnIndex = cursor.getColumnIndex("mime_type"); + if (columnIndex != -1) { + log("Opening Mime TYPE: " + cursor.getString(columnIndex)); } } } finally { |