summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2016-05-25 22:21:47 +0200
committerArne Schwabe <arne@rfc2549.org>2016-05-25 22:21:47 +0200
commit16d942a1a077fbeab59c5502e1b623c6acc82da8 (patch)
tree357ce8ad82ac5320da9a5c9aef4e5fd07013908b /main/src
parent727fed99d567002a33c4b8e315b0677751a3e283 (diff)
Fix crash on import
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java15
1 files changed, 12 insertions, 3 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 462e7ee0..050555c6 100644
--- a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java
+++ b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java
@@ -425,12 +425,19 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback,
if (foundfile == null && filename != null && !filename.equals("")) {
log(R.string.import_could_not_open, filename);
}
-
- addFileSelectDialog(fileType);
+ fileSelectMap.put(fileType, null);
return foundfile;
}
+ private void addMissingFileDialogs()
+ {
+ for (Map.Entry<Utils.FileType, FileSelectLayout> item: fileSelectMap.entrySet()) {
+ if (item.getValue()==null)
+ addFileSelectDialog(item.getKey());
+ }
+ }
+
private void addFileSelectDialog(Utils.FileType type) {
Pair<Integer, String> fileDialogInfo = getFileDialogInfo(type);
@@ -586,7 +593,6 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback,
mEmbeddedPwFile = embedFile(cp.getAuthUserPassFile(), Utils.FileType.USERPW_FILE, false);
}
- updateFileSelectDialogs();
}
private void updateFileSelectDialogs() {
@@ -737,6 +743,9 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback,
@Override
protected void onPostExecute(Integer errorCode) {
mLogLayout.removeView(mProgress);
+ addMissingFileDialogs();
+ updateFileSelectDialogs();
+
if (errorCode == 0) {
displayWarnings();
mResult.mName = getUniqueProfileName(possibleName);