diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-11-22 00:21:48 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2023-12-01 23:28:35 +0100 |
commit | 7aa5ffa1fa8bcc13f0ee71a92b5116594215a48b (patch) | |
tree | 79b1c2db1420a509cb97be261b260c2443ea8846 | |
parent | 65bb6217aab53a8ddb72819265bd04a89ab73d73 (diff) |
Core/Phasing: Fixed startup crash caused by accessing uninitialized global variable
Closes #29449
(cherry picked from commit 35ab7dfa8ef5f79af0ee69ed8c19f4be7a635af5)
-rw-r--r-- | src/server/game/Phasing/PhasingHandler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Phasing/PhasingHandler.cpp b/src/server/game/Phasing/PhasingHandler.cpp index b4eef7b5e90..9c11eb1c56e 100644 --- a/src/server/game/Phasing/PhasingHandler.cpp +++ b/src/server/game/Phasing/PhasingHandler.cpp @@ -538,9 +538,10 @@ void PhasingHandler::InitDbPhaseShift(PhaseShift& phaseShift, uint8 phaseUseFlag if (phaseId) phaseShift.AddPhase(phaseId, GetPhaseFlags(phaseId), nullptr); - else if (std::vector<uint32> const* phasesInGroup = sDB2Manager.GetPhasesForGroup(phaseGroupId)) - for (uint32 phaseInGroup : *phasesInGroup) - phaseShift.AddPhase(phaseInGroup, GetPhaseFlags(phaseInGroup), nullptr); + else if (phaseGroupId) + if (std::vector<uint32> const* phasesInGroup = sDB2Manager.GetPhasesForGroup(phaseGroupId)) + for (uint32 phaseInGroup : *phasesInGroup) + phaseShift.AddPhase(phaseInGroup, GetPhaseFlags(phaseInGroup), nullptr); if (phaseShift.Phases.empty() || phaseShift.HasPhase(DEFAULT_PHASE)) { |