Return if the screensaver window couldn't be created to avoid a warning about using...
authorColin Finck <colin@reactos.org>
Sat, 25 Oct 2008 15:14:09 +0000 (15:14 +0000)
committerColin Finck <colin@reactos.org>
Sat, 25 Oct 2008 15:14:09 +0000 (15:14 +0000)
Spotted by KJK & CL

svn path=/trunk/; revision=36946

reactos/lib/sdk/scrnsave/scrnsave.c

index 8438587..a636bfd 100644 (file)
@@ -185,15 +185,15 @@ static int LaunchScreenSaver(HWND hParent)
                                  0, 0, rc.right, rc.bottom, hParent, NULL,
                                  hMainInstance, NULL);
 
+    if(!hMainWindow)
+        return 1;
+
     // Display window and start pumping messages
-    if (hMainWindow)
-    {
-        ShowWindow(hMainWindow, SW_SHOW);
-        SetCursor(NULL);
+    ShowWindow(hMainWindow, SW_SHOW);
+    SetCursor(NULL);
 
-        while (GetMessage(&msg, NULL, 0, 0))
-            DispatchMessage(&msg);
-    }
+    while (GetMessage(&msg, NULL, 0, 0))
+        DispatchMessage(&msg);
 
     return msg.wParam;
 }