generously add tests for NULL in various menu related functions

This commit is contained in:
marschap committed 2005-02-28 20:21:40 +00:00
1 parent ed90f0f643
commit fcfd6b6b93
4 files changed
+572 -436

No files matched your search

+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);
}