generously add tests for NULL in various menu related functions
This commit is contained in:
1 parent
ed90f0f643
commit
fcfd6b6b93
4 files changed
+572
-436
No files matched your search
+6
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user