Skip to content

Commit

Permalink
Fix mkdirs warning when directory exists (fixes #254) (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicus committed Aug 29, 2022
1 parent 70e5064 commit ebde11f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/src/main/java/com/wynntils/utils/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ public final class FileUtils {
* Wraps File#mkdirs with a log output, in case of failure
*/
public static void mkdir(File dir) {
if (dir.isDirectory()) return;

if (!dir.mkdirs()) {
WynntilsMod.warn("Directory " + dir + " could not be created");
WynntilsMod.error("Directory " + dir + " could not be created");
}
}
}

0 comments on commit ebde11f

Please sign in to comment.