mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 21:36:37 +02:00
api: return NULL instead of empty infolist "key" when context is not found
This commit is contained in:
@@ -47,6 +47,7 @@ Bug fixes::
|
||||
* core: display an error on startup if environment variable "HOME" is not set
|
||||
* core: fix crash when a custom bar item name is already used by a default bar item (issue #2034)
|
||||
* core: fix random timeouts when a lot of concurrent processes are launched with hook_process (issue #2033)
|
||||
* api: return NULL instead of empty infolist "key" when context is not found
|
||||
* irc: display messages 730/731 (monitored nicks online/offline) even if command `/notify` was not used (issue #2049)
|
||||
* irc: remove trailing "\r\n" in signals "irc_out" and "irc_outtags" when messages are queued
|
||||
* irc: fix target buffer of IRC message 337 (whois reply: "is hiding their idle time")
|
||||
|
||||
@@ -1645,24 +1645,24 @@ plugin_api_infolist_key_cb (const void *pointer, void *data,
|
||||
(void) infolist_name;
|
||||
(void) obj_pointer;
|
||||
|
||||
ptr_infolist = infolist_new (NULL);
|
||||
if (!ptr_infolist)
|
||||
return NULL;
|
||||
|
||||
if (arguments && arguments[0])
|
||||
context = gui_key_search_context (arguments);
|
||||
else
|
||||
context = GUI_KEY_CONTEXT_DEFAULT;
|
||||
if (context >= 0)
|
||||
if (context < 0)
|
||||
return NULL;
|
||||
|
||||
ptr_infolist = infolist_new (NULL);
|
||||
if (!ptr_infolist)
|
||||
return NULL;
|
||||
|
||||
for (ptr_key = gui_keys[context]; ptr_key;
|
||||
ptr_key = ptr_key->next_key)
|
||||
{
|
||||
for (ptr_key = gui_keys[context]; ptr_key;
|
||||
ptr_key = ptr_key->next_key)
|
||||
if (!gui_key_add_to_infolist (ptr_infolist, ptr_key))
|
||||
{
|
||||
if (!gui_key_add_to_infolist (ptr_infolist, ptr_key))
|
||||
{
|
||||
infolist_free (ptr_infolist);
|
||||
return NULL;
|
||||
}
|
||||
infolist_free (ptr_infolist);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return ptr_infolist;
|
||||
|
||||
Reference in New Issue
Block a user