fix replaymod crash

This commit is contained in:
wagyourtail 2021-03-28 21:32:48 -07:00
parent c1794dd0ca
commit 9d1b979318
No known key found for this signature in database
GPG Key ID: E6E3EB7DCD4EB017
1 changed files with 8 additions and 1 deletions

View File

@ -77,7 +77,14 @@ public class WorldProvider implements IWorldProvider, Helper {
directory = new File(directory, "baritone");
readme = directory;
} else { // Otherwise, the server must be remote...
String folderName = mc.getCurrentServerData().serverIP;
String folderName;
if (mc.getCurrentServerData() != null) {
folderName = mc.getCurrentServerData().serverIP;
} else {
//replaymod causes null currentServerData and false singleplayer.
currentWorld = null;
return;
}
if (SystemUtils.IS_OS_WINDOWS) {
folderName = folderName.replace(":", "_");
}