From ad3f8d85eb6aa43dde00e2bbecd3b89f88083a1a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 6 Apr 2003 00:34:30 +0000 Subject: Avoid calling API before Window created. --- win32/PlatWin.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'win32') 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(id), &rc); + RECT rc={0,0,0,0}; + if (id) + ::GetClientRect(reinterpret_cast(id), &rc); return PRectangle(rc.left, rc.top, rc.right, rc.bottom); } -- cgit v1.2.3