From fffbd86a1014ad169ed2d68ea58cdddf346faa14 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Jul 2015 00:47:44 +0300 Subject: Add missing checks and non null attributes. --- src/net/eathena/beinghandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/net/eathena/beinghandler.cpp') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 79fddcf18..d12941fcd 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -663,7 +663,6 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg) return; dstBeing = createBeing2(msg, id, job, type); - if (!dstBeing) return; } @@ -831,7 +830,6 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) return; dstBeing = createBeing2(msg, id, job, type); - if (!dstBeing) return; } @@ -1001,7 +999,6 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg) return; dstBeing = createBeing2(msg, id, job, type); - if (!dstBeing) return; } @@ -1120,6 +1117,8 @@ void BeingHandler::processMapTypeProperty(Net::MessageIn &msg) MapTypeProperty2 props; props.data = static_cast(flags); Game *const game = Game::instance(); + if (!game) + return; Map *const map = game->getCurrentMap(); if (!map) return; @@ -1679,6 +1678,8 @@ void BeingHandler::processBeingFakeName(Net::MessageIn &msg) msg.skip(4, "unsued"); Being *const dstBeing = createBeing2(msg, id, job, type); + if (!dstBeing) + return; dstBeing->setSubtype(fromInt(job, BeingTypeId), 0); dstBeing->setTileCoords(x, y); dstBeing->setDirection(dir); -- cgit v1.2.3-70-g09d2