Skip to content

Commit

Permalink
Added null checks to prevent crashes when the client tries to render …
Browse files Browse the repository at this point in the history
…the HUD before it has finished logging in to the server.
  • Loading branch information
Kittychanley committed Jan 6, 2016
1 parent f60f6f6 commit 0838dbb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void render(RenderGameOverlayEvent.Pre event)
TFC_Core.bindTexture(tfcicons);

//Render Tool Mode
if (TFCOptions.enableToolModeIndicator && playerInventory.getCurrentItem() != null)
if (TFCOptions.enableToolModeIndicator && playerInventory.getCurrentItem() != null && playerInfo != null)
{
Item currentItem = playerInventory.getCurrentItem().getItem();

Expand Down Expand Up @@ -206,7 +206,7 @@ else if ("left".equalsIgnoreCase(pos))

GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(mid+1, healthRowHeight, 0, 20, 90, 5);
if (playerInfo.guishowFoodRestoreAmount)
if (playerInfo != null && playerInfo.guishowFoodRestoreAmount)
{
float percentFood2 = Math.min(percentFood + playerInfo.guiFoodRestoreAmount / foodstats.getMaxStomach(player), 1);
GL11.glColor4f(0.0F, 0.6F, 0.0F, 0.3F);
Expand Down

0 comments on commit 0838dbb

Please sign in to comment.