Don't close file systems (otherwise game will crash)

This commit is contained in:
Frank 2022-01-29 17:59:01 +01:00
parent 89516870c9
commit 009028624e

View file

@ -374,10 +374,12 @@ public class ModUtil {
URI uri = URI.create("jar:" + file.toUri()); URI uri = URI.create("jar:" + file.toUri());
FileSystem fs; FileSystem fs;
boolean doClose = false;
try { try {
fs = FileSystems.getFileSystem(uri); fs = FileSystems.getFileSystem(uri);
} }
catch (Exception e) { catch (Exception e) {
doClose = true;
fs = FileSystems.newFileSystem(file); fs = FileSystems.newFileSystem(file);
} }
if (fs != null) { if (fs != null) {
@ -396,7 +398,7 @@ public class ModUtil {
catch (Exception e) { catch (Exception e) {
BCLib.LOGGER.error("Error for " + uri + ": " + e.toString()); BCLib.LOGGER.error("Error for " + uri + ": " + e.toString());
} }
fs.close(); //if (doClose) fs.close();
} }
} }
catch (Exception e) { catch (Exception e) {