Prevented NPE in GuiReplayListEntry draw method
This commit is contained in:
@@ -94,14 +94,16 @@ public class GuiReplayListEntry implements IGuiListEntry {
|
|||||||
y + slotHeight - (mc.fontRendererObj.FONT_HEIGHT) * 2 - 2, Color.WHITE.getRGB());
|
y + slotHeight - (mc.fontRendererObj.FONT_HEIGHT) * 2 - 2, Color.WHITE.getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
String duration = DurationUtils.convertSecondsToShortString(fileInfo.getMetadata().getDuration() / 1000);
|
if(fileInfo != null && fileInfo.getMetadata() != null) {
|
||||||
int durationWidth = mc.fontRendererObj.getStringWidth(duration);
|
String duration = DurationUtils.convertSecondsToShortString(fileInfo.getMetadata().getDuration() / 1000);
|
||||||
|
int durationWidth = mc.fontRendererObj.getStringWidth(duration);
|
||||||
|
|
||||||
Gui.drawRect(x + thumbnailOffset - 2 - durationWidth - 1, y + slotHeight - mc.fontRendererObj.FONT_HEIGHT - 2, x + thumbnailOffset, y + slotHeight,
|
Gui.drawRect(x + thumbnailOffset - 2 - durationWidth - 1, y + slotHeight - mc.fontRendererObj.FONT_HEIGHT - 2, x + thumbnailOffset, y + slotHeight,
|
||||||
0x80000000);
|
0x80000000);
|
||||||
|
|
||||||
mc.fontRendererObj.drawStringWithShadow(duration, x + thumbnailOffset - 1 - durationWidth,
|
mc.fontRendererObj.drawStringWithShadow(duration, x + thumbnailOffset - 1 - durationWidth,
|
||||||
y + slotHeight - mc.fontRendererObj.FONT_HEIGHT, Color.WHITE.getRGB());
|
y + slotHeight - mc.fontRendererObj.FONT_HEIGHT, Color.WHITE.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
String serverName = fileInfo.getMetadata().getServerName();
|
String serverName = fileInfo.getMetadata().getServerName();
|
||||||
if(serverName == null) serverName = ChatFormatting.DARK_RED.toString()+I18n.format("replaymod.gui.iphidden");
|
if(serverName == null) serverName = ChatFormatting.DARK_RED.toString()+I18n.format("replaymod.gui.iphidden");
|
||||||
|
|||||||
Reference in New Issue
Block a user