From: rodin Date: Wed, 5 May 2010 13:47:14 +0000 (+0000) Subject: Fixed segfault when requesting non-existant parent window X-Git-Tag: v0.9~196 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=edc4db52f1fac6cc5f46c48786251e5a91b3406b;p=projects%2Fchimara%2Fchimara.git Fixed segfault when requesting non-existant parent window --- 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; }