avoid uninitialised pointer. thanks to dead.mazayus
authornemo
Thu, 30 Dec 2010 09:58:05 -0500
changeset 4784 d8eafc8dba38
parent 4783 f9564c66a086
child 4785 5047d270e7d3
avoid uninitialised pointer. thanks to dead.mazayus
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Wed Dec 29 22:44:45 2010 -0500
+++ b/hedgewars/uGears.pas	Thu Dec 30 09:58:05 2010 -0500
@@ -1857,12 +1857,15 @@
                     inc(j)
                     end
                 end;
-        if hh <> nil then Gear:= AddVisualGear(0, 0, vgtSpeechBubble);
-        if Gear <> nil then
+        if hh <> nil then 
             begin
-            Gear^.Hedgehog:= hh;
-            Gear^.Text:= text;
-            Gear^.FrameTicks:= x
+            Gear:= AddVisualGear(0, 0, vgtSpeechBubble);
+            if Gear <> nil then
+                begin
+                Gear^.Hedgehog:= hh;
+                Gear^.Text:= text;
+                Gear^.FrameTicks:= x
+                end
             end
         //else ParseCommand('say ' + text, true)
         end