skyboy / MineFactoryReloaded

104 stars 75 forks source link

BlockTankRenderer is prone to NullPointerExceptions if a Fluid is not null but has null IIcons #433

Closed Cojomax99 closed 9 years ago

Cojomax99 commented 9 years ago

https://github.com/skyboy/MineFactoryReloaded/blob/master/src/powercrystals/minefactoryreloaded/render/block/BlockTankRenderer.java#L73

If the Fluid is not null, but the stillIcon/flowingIcon values have not been set (and are thus null), then it will throw a NullPointerException like this one: http://paste.ubuntu.com/10822515/

An additional null check after getIcon is called should fix it.

alexbegt commented 9 years ago

https://github.com/skyboy/MineFactoryReloaded/blob/master/src/powercrystals/minefactoryreloaded/render/block/BlockTankRenderer.java#L180 is part of the crash also, because 218 calls that line to get the icon to render: https://github.com/skyboy/MineFactoryReloaded/blob/master/src/powercrystals/minefactoryreloaded/render/block/BlockTankRenderer.java#L218