--- a/hedgewars/uGearsList.pas Mon Dec 08 10:30:20 2014 -0500
+++ b/hedgewars/uGearsList.pas Mon Dec 08 10:55:56 2014 -0500
@@ -726,9 +726,11 @@
FollowGear:= nil;
if lastGearByUID = Gear then
lastGearByUID := nil;
-if Gear^.Hedgehog^.GearHidden <> Gear then // hidden hedgehogs shouldn't be in the list
+if (Gear^.Hedgehog = nil) or (Gear^.Hedgehog^.GearHidden <> Gear) then // hidden hedgehogs shouldn't be in the list
RemoveGearFromList(Gear);
-Gear^.Hedgehog^.GearHidden:= nil;
+if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.GearHidden = Gear) then
+ Gear^.Hedgehog^.GearHidden:= nil;
+
Dispose(Gear)
end;