Closed StrayIntellectual closed 3 weeks ago
Fixed in the latest main (#319) Was some missing code to prevent not getting an error if an image does not exist
Game crashes on interact with fire extinguisher again
Error message:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.csse3200.game.entities.Entity.getComponent(java.lang.Class)" because "entity" is null
at com.csse3200.game.components.items.ItemTexturePathGetter.getTexturePath(ItemTexturePathGetter.java:35)
at com.csse3200.game.components.items.ItemComponent.getTexturePath(ItemComponent.java:62)
at com.csse3200.game.components.player.InventoryDisplay.updateDisplay(InventoryDisplay.java:128)
at com.csse3200.game.components.player.InventoryDisplay.update(InventoryDisplay.java:149)
at com.csse3200.game.events.EventHandler.lambda$trigger$0(EventHandler.java:96)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at com.csse3200.game.events.EventHandler.forEachListener(EventHandler.java:325)
at com.csse3200.game.events.EventHandler.trigger(EventHandler.java:96)
at com.csse3200.game.components.player.InventoryComponent.addItem(InventoryComponent.java:218)
at com.csse3200.game.components.station.FireExtinguisherHandlerComponent.giveExtinguisher(FireExtinguisherHandlerComponent.java:105)
at com.csse3200.game.components.station.FireExtinguisherHandlerComponent.givePutExtinguisher(FireExtinguisherHandlerComponent.java:79)
at com.csse3200.game.components.station.FireExtinguisherHandlerComponent.handleFireExtinguisher(FireExtinguisherHandlerComponent.java:36)
at com.csse3200.game.components.player.PlayerActions.interact(PlayerActions.java:99)
Description
Game crashes on interact with fire extinguisher
How To Reproduce
Steps to reproduce the behaviour:
Expected Behaviour
Standard fire extinguisher behaviour expected, pickup etc.
Temporary Fix
Remove fire extinguisher from game, potentially unnecessary bloat.