Skip to content

Commit

Permalink
fix: crash in use with creature (add nullptr check) (opentibiabr#2899)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospess0a authored Sep 19, 2024
1 parent 563b0f7 commit ae39682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3909,7 +3909,7 @@ void Game::playerUseWithCreature(uint32_t playerId, const Position &fromPos, uin
}

const std::shared_ptr<Monster> 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()) {
Expand Down

0 comments on commit ae39682

Please sign in to comment.