Fix crash in case of critical image missing 0.9.21
authorunc0rr
Sat, 03 Jan 2015 00:28:33 +0300
branch0.9.21
changeset 10735 42af3bfc832c
parent 10733 b22c57f45e86
child 10737 408803ca951a
Fix crash in case of critical image missing
hedgewars/uStore.pas
--- a/hedgewars/uStore.pas	Fri Jan 02 00:14:49 2015 +0300
+++ b/hedgewars/uStore.pas	Sat Jan 03 00:28:33 2015 +0300
@@ -611,17 +611,17 @@
     // loading failed
     if tmpsurf = nil then
         begin
-
-        // anounce that loading failed
-        OutError(msgFailed, false);
-
         // output sdl error if loading failed when data source was available
         if rwops <> nil then
             begin
+            // anounce that loading failed
+            OutError(msgFailed, false);
+
             SDLTry(false, (imageFlags and ifCritical) <> 0);
             // rwops was already freed by IMG_Load_RW
             rwops:= nil;
-            end;
+            end else
+            OutError(msgFailed, (imageFlags and ifCritical) <> 0);
         exit;
         end;