diff --git a/windows/dialog.c b/windows/dialog.c
index c02c7f65e55279ed5d9805a5097010ad2165d6f7..e3a72aeafd2d52106f177db14394c68ffa62f195 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -688,9 +688,11 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate,
         if (hFont)
         {
             SIZE charSize;
-            DIALOG_GetCharSize(hFont,&charSize); 
-            xUnit = charSize.cx;
-            yUnit = charSize.cy;
+            if (DIALOG_GetCharSize(hFont,&charSize))
+            {
+                xUnit = charSize.cx;
+                yUnit = charSize.cy;
+            }
         }
 	TRACE("units = %d,%d\n", xUnit, yUnit );
     }