Fix crash caused by speechbubbles when restoring from save or joining already started net game
authorunc0rr
Sun, 24 May 2009 19:45:20 +0000
changeset 2114 9a8ccc7bc3d8
parent 2113 89d0fa6734af
child 2115 1c9a8081aef6
Fix crash caused by speechbubbles when restoring from save or joining already started net game
hedgewars/CCHandlers.inc
--- a/hedgewars/CCHandlers.inc	Sun May 24 16:02:16 2009 +0000
+++ b/hedgewars/CCHandlers.inc	Sun May 24 19:45:20 2009 +0000
@@ -406,9 +406,12 @@
 if byte(s[1]) < 4 then
     begin
     Gear:= AddVisualGear(0, 0, vgtSpeechBubble);
-    Gear^.Hedgehog:= CurrentHedgehog;
-    Gear^.Text:= text;
-    Gear^.FrameTicks:= byte(s[1])
+    if Gear <> nil then
+       begin
+       Gear^.Hedgehog:= CurrentHedgehog;
+       Gear^.Text:= text;
+       Gear^.FrameTicks:= byte(s[1])
+       end
     end
 else
     begin