diff --git a/src/loop.cpp b/src/loop.cpp index 9d64d8759b8..71d505b1917 100644 --- a/src/loop.cpp +++ b/src/loop.cpp @@ -460,7 +460,11 @@ void countUpdate(bool synch) setLasSatExists(false, i); for (const STRUCTURE *psCBuilding : apsStructLists[i]) { - if (psCBuilding->pStructureType->type == REF_SAT_UPLINK && psCBuilding->status == SS_BUILT) + if (psCBuilding == nullptr || isDead(psCBuilding)) + { + continue; + } + if (psCBuilding->pStructureType && psCBuilding->pStructureType->type == REF_SAT_UPLINK && psCBuilding->status == SS_BUILT) { setSatUplinkExists(true, i); } @@ -472,7 +476,11 @@ void countUpdate(bool synch) } for (const STRUCTURE *psCBuilding : mission.apsStructLists[i]) { - if (psCBuilding->pStructureType->type == REF_SAT_UPLINK && psCBuilding->status == SS_BUILT) + if (psCBuilding == nullptr || isDead(psCBuilding)) + { + continue; + } + if (psCBuilding->pStructureType && psCBuilding->pStructureType->type == REF_SAT_UPLINK && psCBuilding->status == SS_BUILT) { setSatUplinkExists(true, i); }