aboutsummaryrefslogtreecommitdiff
path: root/src/game/MovementHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/MovementHandler.cpp')
-rw-r--r--src/game/MovementHandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp
index 68deb5af9f4..5ec73f9cb48 100644
--- a/src/game/MovementHandler.cpp
+++ b/src/game/MovementHandler.cpp
@@ -72,7 +72,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
Map * newMap = MapManager::Instance().CreateMap(loc.mapid, GetPlayer(), 0);
// the CanEnter checks are done in TeleporTo but conditions may change
// while the player is in transit, for example the map may get full
- if (!newMap->CanEnter(GetPlayer()))
+ if (!newMap || !newMap->CanEnter(GetPlayer()))
{
sLog.outError("Map %d could not be created for player %d, porting player to homebind", loc.mapid, GetPlayer()->GetGUIDLow());
GetPlayer()->RelocateToHomebind(loc.mapid);