# HG changeset patch
# User koda
# Date 1337633674 -7200
# Node ID 9007531f813f01af4d132cecd23c4f646b4f7b28
# Parent  2468316c1d9dc56eacee9ab4efd8cca6bd96d2d3
add a nilcheck

diff -r 2468316c1d9d -r 9007531f813f hedgewars/uTouch.pas
--- a/hedgewars/uTouch.pas	Mon May 21 16:46:24 2012 -0400
+++ b/hedgewars/uTouch.pas	Mon May 21 22:54:34 2012 +0200
@@ -271,7 +271,7 @@
                 ParseTeamCommand('put');
                 targetted:= true;
                 end
-            else if CurAmmoGear^.AmmoType = amSwitch then
+            else if (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amSwitch) then
                 ParseTeamCommand('switch')
             else WriteLnToConsole(inttostr(ord(Ammoz[CurrentHedgehog^.CurAmmoType].NameId)) + ' ' + inttostr(ord(sidSwitch)));
     end;