From: Marijn van Vliet Date: Wed, 5 May 2010 13:47:14 +0000 (+0000) Subject: Fixed segfault when requesting non-existant parent window X-Git-Url: https://git.stderr.nl/gitweb?p=rodin%2Fchimara.git;a=commitdiff_plain;h=6d86f63cea38cf554181e810230e15aefa90a604 Fixed segfault when requesting non-existant parent window git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@269 ddfedd41-794f-dd11-ae45-00112f111e67 --- diff --git a/libchimara/window.c b/libchimara/window.c index 011b5fb..56cbd70 100644 --- a/libchimara/window.c +++ b/libchimara/window.c @@ -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; }