From 98d4baabeda2382568da2c61424b7d3962ab1974 Mon Sep 17 00:00:00 2001 From: def Date: Mon, 12 Oct 2020 16:23:09 +0200 Subject: [PATCH] Fix clang-analyzer-core.NonNullParamChecker /media/ddnet/src/game/server/entities/projectile.cpp:201:37: warning: Forming reference to null pointer [clang-analyzer-core.NonNullParamChecker] Found = GetNearestAirPosPlayer(pTargetChr->m_Pos, &PossiblePos); ^ --- src/game/server/entities/projectile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/server/entities/projectile.cpp b/src/game/server/entities/projectile.cpp index 7032c6f56..ddad5171f 100644 --- a/src/game/server/entities/projectile.cpp +++ b/src/game/server/entities/projectile.cpp @@ -198,7 +198,7 @@ void CProjectile::Tick() vec2 PossiblePos; if(!Collide) - Found = GetNearestAirPosPlayer(pTargetChr->m_Pos, &PossiblePos); + Found = GetNearestAirPosPlayer(pTargetChr ? pTargetChr->m_Pos : ColPos, &PossiblePos); else Found = GetNearestAirPos(NewPos, CurPos, &PossiblePos);