# HG changeset patch
# User nemo
# Date 1293680685 18000
# Node ID f9564c66a086c84ff338c79de412fb421d844cf0
# Parent  603916ddf4b62e84b8839244080c9fe5144b19aa
nil check

diff -r 603916ddf4b6 -r f9564c66a086 hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Thu Dec 30 01:44:55 2010 +0100
+++ b/hedgewars/uGears.pas	Wed Dec 29 22:44:45 2010 -0500
@@ -1840,7 +1840,7 @@
     if (x < 4) and (TeamsArray[t] <> nil) then
         begin
             // if team matches current hedgehog team, default to current hedgehog
-            if (i = 0) and (CurrentHedgehog^.Team = TeamsArray[t]) then hh:= CurrentHedgehog
+            if (i = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Team = TeamsArray[t]) then hh:= CurrentHedgehog
             else 
                 begin
             // otherwise use the first living hog or the hog amongs the remaining ones indicated by i