aboutsummaryrefslogtreecommitdiff
path: root/src/win
diff options
context:
space:
mode:
Diffstat (limited to 'src/win')
-rw-r--r--src/win/native/GodWindow.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/win/native/GodWindow.cpp b/src/win/native/GodWindow.cpp
index 203542f7..799a3cc6 100644
--- a/src/win/native/GodWindow.cpp
+++ b/src/win/native/GodWindow.cpp
@@ -14,14 +14,14 @@ LRESULT CALLBACK GodWndProc(HWND hWnd, UINT uMsg, WPARAM wParam,
if (app) {
LRESULT result;
- const auto handled = app->GetGodWindow()->HandleGodWindowMessage(
- hWnd, uMsg, wParam, lParam, &result);
- if (handled)
- return result;
- else
- return DefWindowProcW(hWnd, uMsg, wParam, lParam);
- } else
- return DefWindowProcW(hWnd, uMsg, wParam, lParam);
+ auto god_window = app->GetGodWindow();
+ if (god_window != nullptr) {
+ const auto handled = god_window->HandleGodWindowMessage(
+ hWnd, uMsg, wParam, lParam, &result);
+ if (handled) return result;
+ }
+ }
+ return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
GodWindow::GodWindow(WinUiApplication* application) {