diff options
-rw-r--r-- | win32/PlatWin.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index d2b88bda3..3f4dffc41 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -781,8 +781,9 @@ void Window::SetPositionRelative(PRectangle rc, Window w) { } PRectangle Window::GetClientPosition() { - RECT rc; - ::GetClientRect(reinterpret_cast<HWND>(id), &rc); + RECT rc={0,0,0,0}; + if (id) + ::GetClientRect(reinterpret_cast<HWND>(id), &rc); return PRectangle(rc.left, rc.top, rc.right, rc.bottom); } |