summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-11-29 19:15:58 +0100
committerArne Schwabe <arne@rfc2549.org>2013-11-29 19:15:58 +0100
commitd5e947f2dd9ba93a4bb6a801d0ef8ad21d43d8d2 (patch)
tree047e89df785e68c0de0abc688e56bcec2df57226 /src
parentdd9c8a6b22d9ef11c11a6e38de82d80657258b9e (diff)
Fix empty profile when importing from a content provider
Diffstat (limited to 'src')
-rw-r--r--src/de/blinkt/openvpn/ConfigConverter.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/de/blinkt/openvpn/ConfigConverter.java b/src/de/blinkt/openvpn/ConfigConverter.java
index 75620455..d0782a8a 100644
--- a/src/de/blinkt/openvpn/ConfigConverter.java
+++ b/src/de/blinkt/openvpn/ConfigConverter.java
@@ -188,7 +188,7 @@ public class ConfigConverter extends ListActivity {
if(mResult.mName!=null && !ConfigParser.CONVERTED_PROFILE.equals(mResult.mName))
newname=mResult.mName;
- while(vpl.getProfileByName(newname)!=null) {
+ while(newname==null || vpl.getProfileByName(newname)!=null) {
i++;
if(i==1)
newname = getString(R.string.converted_profile);
@@ -368,7 +368,10 @@ public class ConfigConverter extends ListActivity {
//log(R.string.import_experimental);
log(R.string.importing_config,data.toString());
try {
- if(data.getScheme().equals("file")) {
+ if(data.getScheme().equals("file") ||
+ data.getLastPathSegment().endsWith(".ovpn") ||
+ data.getLastPathSegment().endsWith(".conf"))
+ {
mPossibleName = data.getLastPathSegment();
if(mPossibleName!=null){
mPossibleName =mPossibleName.replace(".ovpn", "");