From ae3968295a5ba78fa98389e1e36f4afeb9d20288 Mon Sep 17 00:00:00 2001 From: Karin Date: Thu, 19 Sep 2024 02:01:25 -0300 Subject: [PATCH] fix: crash in use with creature (add nullptr check) (#2899) --- src/game/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 7b60220ecf9..5e99dda81fa 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -3909,7 +3909,7 @@ void Game::playerUseWithCreature(uint32_t playerId, const Position &fromPos, uin } const std::shared_ptr monster = creature->getMonster(); - if (monster && monster->isFamiliar() && creature->getMaster()->getPlayer() == player && (it.isRune() || it.type == ITEM_TYPE_POTION)) { + if (monster && monster->isFamiliar() && creature->getMaster() && creature->getMaster()->getPlayer() == player && (it.isRune() || it.type == ITEM_TYPE_POTION)) { player->setNextPotionAction(OTSYS_TIME() + g_configManager().getNumber(EX_ACTIONS_DELAY_INTERVAL, __FUNCTION__)); if (it.isMultiUse()) {