generously add tests for NULL in various menu related functions

This commit is contained in:
marschap
2005-02-28 20:21:40 +00:00
parent ed90f0f643
commit fcfd6b6b93
4 changed files with 572 additions and 436 deletions
+6 -2
View File
@@ -65,12 +65,16 @@ int screen_remove_widget (Screen * s, Widget * w);
/* List functions */
static inline Widget * screen_getfirst_widget (Screen * s)
{
return LL_GetFirst(s->widgetlist);
return (Widget *) ((s != NULL)
? LL_GetFirst(s->widgetlist)
: NULL);
}
static inline Widget * screen_getnext_widget (Screen * s)
{
return LL_GetNext(s->widgetlist);
return (Widget *) ((s != NULL)
? LL_GetNext(s->widgetlist)
: NULL);
}