From 99e3acbc8656509bc974a1772a6a648c829af665 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 12 Feb 2014 00:01:13 +0100 Subject: Bug Fixes --- src/de/blinkt/openvpn/activities/ConfigConverter.java | 5 +++-- src/de/blinkt/openvpn/fragments/Utils.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/de/blinkt/openvpn') diff --git a/src/de/blinkt/openvpn/activities/ConfigConverter.java b/src/de/blinkt/openvpn/activities/ConfigConverter.java index e999fe9f..792c9796 100644 --- a/src/de/blinkt/openvpn/activities/ConfigConverter.java +++ b/src/de/blinkt/openvpn/activities/ConfigConverter.java @@ -512,7 +512,7 @@ public class ConfigConverter extends ListActivity implements FileSelectCallback try { - if (cursor.moveToFirst()) { + if (cursor!=null && cursor.moveToFirst()) { int cidx = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); if (cidx != -1) { @@ -526,7 +526,8 @@ public class ConfigConverter extends ListActivity implements FileSelectCallback } } } finally { - cursor.close(); + if(cursor!=null) + cursor.close(); } if (possibleName != null) { possibleName = possibleName.replace(".ovpn", ""); diff --git a/src/de/blinkt/openvpn/fragments/Utils.java b/src/de/blinkt/openvpn/fragments/Utils.java index 6f06f35a..9117f158 100644 --- a/src/de/blinkt/openvpn/fragments/Utils.java +++ b/src/de/blinkt/openvpn/fragments/Utils.java @@ -167,7 +167,7 @@ public class Utils { String prefix = ""; try { - if (cursor.moveToFirst()) { + if (cursor!=null && cursor.moveToFirst()) { int cidx = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); if (cidx != -1) { String displayName = cursor.getString(cidx); @@ -177,7 +177,8 @@ public class Utils { } } } finally { - cursor.close(); + if(cursor!=null) + cursor.close(); } switch (ft) { -- cgit v1.2.3