Gracefully handle incomplete QuickMode cache

This commit is contained in:
Jonas Herzig
2019-07-19 21:29:22 +02:00
parent 1245f38267
commit 9c25396016

View File

@@ -75,6 +75,7 @@ import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
//#endif //#endif
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.io.EOFException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
@@ -307,6 +308,8 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
try (InputStream cacheIn = cacheOpt.get()) { try (InputStream cacheIn = cacheOpt.get()) {
success = loadFromCache(cacheIn, indexIn, progress); success = loadFromCache(cacheIn, indexIn, progress);
} }
} catch (EOFException e) {
LOGGER.error("Re-analysing replay due to premature EOF while loading the cache:", e);
} finally { } finally {
if (!success) { if (!success) {
buf = null; buf = null;