Skip to content

Commit

Permalink
Add a check if "LOCALAPPDATA" is null, and show the OS. (This is not …
Browse files Browse the repository at this point in the history
…much of a fix, but it's technically better than just a blank NPE)
  • Loading branch information
AlexIIL committed Jul 8, 2023
1 parent e69e8b2 commit 522f4fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/quiltmc/loader/impl/util/GlobalPaths.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public static Path getConfigDir() {

if (os.contains("win")) {
String configHome = System.getenv("LOCALAPPDATA");
if (configHome == null) {
throw new RuntimeException("Missing env 'LOCALAPPATA' for '" + os + "'");
}
Path base = Paths.get(configHome);
config = base.resolve("QuiltMC").resolve("QuiltLoaderAndMods");

Expand Down Expand Up @@ -67,6 +70,9 @@ public static Path getCacheDir() {

if (os.contains("win")) {
String configHome = System.getenv("LOCALAPPDATA");
if (configHome == null) {
throw new RuntimeException("Missing env 'LOCALAPPATA' for '" + os + "'");
}
Path base = Paths.get(configHome);
cache = base.resolve("QuiltMC").resolve("QuiltLoaderAndMods").resolve("Cache");

Expand Down

0 comments on commit 522f4fd

Please sign in to comment.