mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 08:13:14 +02:00
core: check that infolist is not NULL in next/prev/reset_item_cursor functions
This commit is contained in:
@@ -314,6 +314,9 @@ infolist_new_var_time (struct t_infolist_item *item,
|
||||
struct t_infolist_item *
|
||||
infolist_next (struct t_infolist *infolist)
|
||||
{
|
||||
if (!infolist)
|
||||
return NULL;
|
||||
|
||||
if (!infolist->ptr_item)
|
||||
{
|
||||
infolist->ptr_item = infolist->items;
|
||||
@@ -332,6 +335,9 @@ infolist_next (struct t_infolist *infolist)
|
||||
struct t_infolist_item *
|
||||
infolist_prev (struct t_infolist *infolist)
|
||||
{
|
||||
if (!infolist)
|
||||
return NULL;
|
||||
|
||||
if (!infolist->ptr_item)
|
||||
{
|
||||
infolist->ptr_item = infolist->last_item;
|
||||
@@ -348,6 +354,9 @@ infolist_prev (struct t_infolist *infolist)
|
||||
void
|
||||
infolist_reset_item_cursor (struct t_infolist *infolist)
|
||||
{
|
||||
if (!infolist)
|
||||
return;
|
||||
|
||||
infolist->ptr_item = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user