From fe10799bfe26fdf15a590d23c54436107bc06ca2 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 31 Jul 2023 17:53:58 +0400 Subject: [PATCH] Add an assert for possible null pointer dereference --- components/detournavigator/asyncnavmeshupdater.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/detournavigator/asyncnavmeshupdater.cpp b/components/detournavigator/asyncnavmeshupdater.cpp index eb218c4681..3a1b6fd77a 100644 --- a/components/detournavigator/asyncnavmeshupdater.cpp +++ b/components/detournavigator/asyncnavmeshupdater.cpp @@ -457,6 +457,8 @@ namespace DetourNavigator const auto offMeshConnections = mOffMeshConnectionsManager.get().get(job.mChangedTile); + assert(preparedNavMeshDataPtr != nullptr); + const UpdateNavMeshStatus status = navMeshCacheItem.lock()->updateTile(job.mChangedTile, std::move(cachedNavMeshData), makeNavMeshTileData(*preparedNavMeshDataPtr, offMeshConnections, job.mAgentBounds, job.mChangedTile,