ソースを参照

ZipExporterPreference: account for directory already existing

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
master
Jason A. Donenfeld 6年前
コミット
ba1b6c7095
1個のファイルの変更1行の追加1行の削除
  1. +1
    -1
      app/src/main/java/com/wireguard/android/preference/ZipExporterPreference.java

+ 1
- 1
app/src/main/java/com/wireguard/android/preference/ZipExporterPreference.java ファイルの表示

@@ -76,7 +76,7 @@ public class ZipExporterPreference extends Preference {
throw exception;
final File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
final File file = new File(path, "wireguard-export.zip");
if (!path.mkdirs())
if (!path.isDirectory() && !path.mkdirs())
throw new IOException("Cannot create output directory");
try (ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(file))) {
for (int i = 0; i < futureConfigs.size(); ++i) {


読み込み中…
キャンセル
保存