Unverified Commit 1ec041a4 authored by Felix Bergmann's avatar Felix Bergmann Committed by GitHub

Directory Bug

The correct pattern to make a directory is: `if (!dir.mkdirs() && !dir.isDirectory()) { error }` mkdirs checks for exists so the exists check is redundant.
parent 2433a7e8
...@@ -57,7 +57,7 @@ public class FileUtils { ...@@ -57,7 +57,7 @@ public class FileUtils {
public static void makeDirs(@Nullable File dir) { public static void makeDirs(@Nullable File dir) {
if (dir != null) { if (dir != null) {
synchronized (MKDIR_SYNC) { synchronized (MKDIR_SYNC) {
if (!dir.exists() && !dir.mkdirs()) { if (!dir.mkdirs() && !dir.isDirectory()) {
throw new JadxRuntimeException("Can't create directory " + dir); throw new JadxRuntimeException("Can't create directory " + dir);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment