diff options
author | rhyskidd <rhyskidd@076cb2c4-205e-83fd-5cf3-1be9aa105544> | 2012-05-30 13:26:32 +0000 |
---|---|---|
committer | rhyskidd <rhyskidd@076cb2c4-205e-83fd-5cf3-1be9aa105544> | 2012-05-30 13:26:32 +0000 |
commit | eaa453335563d670d856da44bf4ea1f332c618a7 (patch) | |
tree | a976bf3e0fc4b690042915745e637eb6b00929e4 /Stars45/TacticalAI.cpp | |
parent | 035cfd86e5d221cffb2673e936dcb8703e28ce4b (diff) | |
download | starshatter-eaa453335563d670d856da44bf4ea1f332c618a7.zip starshatter-eaa453335563d670d856da44bf4ea1f332c618a7.tar.gz starshatter-eaa453335563d670d856da44bf4ea1f332c618a7.tar.bz2 |
Ensure check for NULL pointer occurs prior to use, not after
Diffstat (limited to 'Stars45/TacticalAI.cpp')
-rw-r--r-- | Stars45/TacticalAI.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Stars45/TacticalAI.cpp b/Stars45/TacticalAI.cpp index e8bc09b..32d364a 100644 --- a/Stars45/TacticalAI.cpp +++ b/Stars45/TacticalAI.cpp @@ -1,6 +1,6 @@ /* Project Starshatter 4.5
Destroyer Studios LLC
- Copyright © 1997-2004. All Rights Reserved.
+ Copyright (C) 1997-2004. All Rights Reserved.
SUBSYSTEM: Stars.exe
FILE: TacticalAI.cpp
@@ -194,7 +194,8 @@ TacticalAI::CheckObjectives() bool
TacticalAI::ProcessOrders()
{
- ship_ai->ClearPatrol();
+ if (ship_ai)
+ ship_ai->ClearPatrol();
if (orders && orders->EMCON() > 0) {
int desired_emcon = orders->EMCON();
|