aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-07-18 20:26:05 +0200
committerShauren <shauren.trinity@gmail.com>2016-07-18 20:26:05 +0200
commitcc07a491f64fa958c8a27079bd2def84c577f816 (patch)
tree5ebfe77cb502623f44705075b8b4261d955ffb15 /src
parentdf53a080fcdd011ee035cfdeb3f8b5cd18ca6acc (diff)
Core/Spells: Fixed possible null pointer dereference6.2.4/21742
Coverity CID 1357406
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 4fa16a53624..2a21d31b0ad 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -10711,7 +10711,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell
return 0;
if (spellInfo->RangeEntry->MaxRangeFriend == spellInfo->RangeEntry->MaxRangeHostile)
return spellInfo->GetMaxRange();
- if (target == NULL)
+ if (!target)
return spellInfo->GetMaxRange(true);
return spellInfo->GetMaxRange(!IsHostileTo(target));
}
@@ -10722,6 +10722,8 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
return 0;
if (spellInfo->RangeEntry->MinRangeFriend == spellInfo->RangeEntry->MinRangeHostile)
return spellInfo->GetMinRange();
+ if (!target)
+ return spellInfo->GetMinRange(true);
return spellInfo->GetMinRange(!IsHostileTo(target));
}