mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
Fix crash on /upgrade if there are some nicks in a nicklist without prefix or prefix_color defined
This commit is contained in:
+39
-30
@@ -1187,31 +1187,37 @@ gui_bar_item_default_buffer_nicklist (void *data, struct t_gui_bar_item *item,
|
||||
strcat (buf, " ");
|
||||
}
|
||||
}
|
||||
if (strchr (ptr_nick->prefix_color, '.'))
|
||||
if (ptr_nick->prefix_color)
|
||||
{
|
||||
config_file_search_with_string (ptr_nick->prefix_color,
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
if (ptr_option)
|
||||
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (buf, gui_color_get_custom (ptr_nick->prefix_color));
|
||||
if (strchr (ptr_nick->prefix_color, '.'))
|
||||
{
|
||||
config_file_search_with_string (ptr_nick->prefix_color,
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
if (ptr_option)
|
||||
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (buf, gui_color_get_custom (ptr_nick->prefix_color));
|
||||
}
|
||||
}
|
||||
if (ptr_nick->prefix)
|
||||
strcat (buf, ptr_nick->prefix);
|
||||
if (strchr (ptr_nick->color, '.'))
|
||||
if (ptr_nick->color)
|
||||
{
|
||||
config_file_search_with_string (ptr_nick->color,
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
if (ptr_option)
|
||||
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (buf, gui_color_get_custom (ptr_nick->color));
|
||||
if (strchr (ptr_nick->color, '.'))
|
||||
{
|
||||
config_file_search_with_string (ptr_nick->color,
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
if (ptr_option)
|
||||
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (buf, gui_color_get_custom (ptr_nick->color));
|
||||
}
|
||||
}
|
||||
strcat (buf, ptr_nick->name);
|
||||
}
|
||||
@@ -1221,17 +1227,20 @@ gui_bar_item_default_buffer_nicklist (void *data, struct t_gui_bar_item *item,
|
||||
{
|
||||
strcat (buf, " ");
|
||||
}
|
||||
if (strchr (ptr_group->color, '.'))
|
||||
if (ptr_group->color)
|
||||
{
|
||||
config_file_search_with_string (ptr_group->color,
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
if (ptr_option)
|
||||
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (buf, gui_color_get_custom (ptr_group->color));
|
||||
if (strchr (ptr_group->color, '.'))
|
||||
{
|
||||
config_file_search_with_string (ptr_group->color,
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
if (ptr_option)
|
||||
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (buf, gui_color_get_custom (ptr_group->color));
|
||||
}
|
||||
}
|
||||
strcat (buf, gui_nicklist_get_group_start (ptr_group->name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user