mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-03-13 17:46:58 +08:00
Fix NPE
This commit is contained in:
parent
869f57cbf1
commit
f133fcf66c
@ -287,7 +287,8 @@ public class DefaultLauncher extends Launcher {
|
||||
Process process;
|
||||
try {
|
||||
ProcessBuilder builder = new ProcessBuilder(rawCommandLine).directory(runDirectory);
|
||||
builder.environment().put("APPDATA", options.getGameDir().getAbsoluteFile().getParent());
|
||||
String appdata = options.getGameDir().getAbsoluteFile().getParent();
|
||||
if (appdata != null) builder.environment().put("APPDATA", appdata);
|
||||
process = builder.start();
|
||||
} catch (IOException e) {
|
||||
throw new ProcessCreationException(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user