Merge pull request #675 from altrisi/1.17-nbtio-crash

Fix NbtIo crash when loading appdata
This commit is contained in:
gnembon authored and GitHub committed 2021-01-14 23:56:29 -04:00
commit 0df16729db
1 file changed
+7 -2
@@ -76,9 +76,14 @@ public class FileModule extends Module
} }
catch (IOException e) catch (IOException e)
{ {
try // Copy of NbtIo.read(File) because that's now client-side only
if (!file.exists())
{ {
return NbtIo.read(file); return null;
}
try (DataInputStream in = new DataInputStream(new FileInputStream(file)))
{
return NbtIo.read(in);
} }
catch (IOException ioException) catch (IOException ioException)
{ {