aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 6878390..fb5764b 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -180,12 +180,12 @@ void InitializeMainWindow(const HWND hWnd)
/* Look up DPI. */
if (auto lib = Library::Maybe(L"User32.dll");
- auto GetDpiForWindow = lib->GetProcAddress<UINT(HWND)>("GetDpiForWindow"))
+ auto GetDpiForWindow = lib? lib->GetProcAddress<UINT(HWND)>("GetDpiForWindow"): nullptr)
g_dpi = GetDpiForWindow(hWnd);
/* Load normal font. */
if (auto lib = Library::Maybe(L"User32.dll");
- lib->GetProcAddress<void>("SystemParametersInfoW")) {
+ lib && lib->GetProcAddress<void>("SystemParametersInfoW")) {
NONCLIENTMETRICS m = {sizeof(NONCLIENTMETRICS)};
Require(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &m, 0));
g_hfNormal = Require(CreateFontIndirect(&m.lfMessageFont));