From eedaf75e9e24327d5b9e3109ce8cda30f91c62e4 Mon Sep 17 00:00:00 2001 From: johni0702 Date: Fri, 29 Jul 2016 14:04:05 +0200 Subject: [PATCH] Fix GuiReplayViewer crashing when metadata of replay is missing --- .../com/replaymod/replay/gui/screen/GuiReplayViewer.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java b/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java index e610b9a4..2af222b8 100755 --- a/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java +++ b/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java @@ -86,12 +86,9 @@ public class GuiReplayViewer extends GuiScreen { } final ReplayMetaData metaData = replayFile.getMetaData(); - obj.consume(new Supplier() { - @Override - public GuiReplayEntry get() { - return new GuiReplayEntry(file, metaData, theThumb); - } - }); + if (metaData != null) { + obj.consume(() -> new GuiReplayEntry(file, metaData, theThumb)); + } } catch (Exception e) { FMLLog.getLogger().error("Could not load Replay File " + file.getName(), e); }