From 4053fdf43c09398154bb9403e6e652315addecc8 Mon Sep 17 00:00:00 2001 From: randy Date: Tue, 1 Apr 2025 11:58:25 -0600 Subject: [PATCH] Fixed null pointer exception when runecrafting without a familiar --- .../skill/runecrafting/SnowscapePouchListener.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Server/src/main/content/global/skill/runecrafting/SnowscapePouchListener.kt b/Server/src/main/content/global/skill/runecrafting/SnowscapePouchListener.kt index 549c4445e..0c98a6268 100755 --- a/Server/src/main/content/global/skill/runecrafting/SnowscapePouchListener.kt +++ b/Server/src/main/content/global/skill/runecrafting/SnowscapePouchListener.kt @@ -26,10 +26,12 @@ class SnowscapePouchListener : InteractionListener { // Called by the runecraft pulse fun emptyPouches(player: Player) { if (amountInInventory(player, Items.PURE_ESSENCE_7936) > 0 || amountInInventory(player, Items.RUNE_ESSENCE_1436) > 0) return - - val familiar = player.getFamiliarManager().getFamiliar() - if (familiar.isBurdenBeast() && (familiar as BurdenBeast).getContainer().containsAtLeastOneItem(Items.PURE_ESSENCE_7936)) { - (familiar as BurdenBeast).transfer(Item(Items.PURE_ESSENCE_7936), 99, true) + + if (player.getFamiliarManager().hasFamiliar()) { + val familiar = player.getFamiliarManager().getFamiliar() + if (familiar.isBurdenBeast() && (familiar as BurdenBeast).getContainer().containsAtLeastOneItem(Items.PURE_ESSENCE_7936)) { + (familiar as BurdenBeast).transfer(Item(Items.PURE_ESSENCE_7936), 99, true) + } } for (pouchId in pouchIds) {