[gtk+] Don't crash on NULL parent



commit f7185ec704f0681b3a9ce910a0f35d93549f01e3
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Aug 17 16:59:47 2009 +0200

    Don't crash on NULL parent
    
    The parent window can be NULL, check for that before dereferencing.

 gdk/gdkwindow.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index b9d0bff..8706608 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -7295,7 +7295,7 @@ gdk_window_get_geometry (GdkWindow *window,
 	  /* This reports the position wrt to the native parent, we need to convert
 	     it to be relative to the client side parent */
 	  parent = private->parent;
-	  if (!gdk_window_has_impl (parent))
+	  if (parent && !gdk_window_has_impl (parent))
 	    {
 	      *x -= parent->abs_x;
 	      *y -= parent->abs_y;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]