Fixed segfault when requesting non-existant parent window
authorMarijn van Vliet <marijn.vanvliet@med.kuleuven.be>
Wed, 5 May 2010 13:47:14 +0000 (13:47 +0000)
committerMarijn van Vliet <marijn.vanvliet@med.kuleuven.be>
Wed, 5 May 2010 13:47:14 +0000 (13:47 +0000)
git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@269 ddfedd41-794f-dd11-ae45-00112f111e67

libchimara/window.c

index 011b5fbf99ee6859f45940d1ba82ddf14452d5ee..56cbd700e6d66f2a5d9b2f496073a18fcf91eb05 100644 (file)
@@ -170,7 +170,11 @@ winid_t
 glk_window_get_parent(winid_t win)
 {
        VALID_WINDOW(win, return NULL);
+
        /* Value will also be NULL if win is the root window */
+       if(win->window_node->parent == NULL)
+               return NULL;
+
        return (winid_t)win->window_node->parent->data;
 }