core: fix crash when a root bar has conditions different from active/inactive/nicklist (closes #317)

This commit is contained in:
Sébastien Helleu 2015-01-23 21:21:39 +01:00
parent a617cd857a
commit ed9e146e46
2 changed files with 6 additions and 3 deletions

View File

@ -23,6 +23,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
=== Bugs fixed
* core: fix crash when a root bar has conditions different from
active/inactive/nicklist (closes #317)
* irc: fix /join on a channel buffer opened with autojoin but which failed to
join
* irc: send QUIT to server and no PART for channels when the server buffer

View File

@ -402,7 +402,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar,
}
else if (string_strcasecmp (conditions, "nicklist") == 0)
{
if (window->buffer && !window->buffer->nicklist)
if (window && window->buffer && !window->buffer->nicklist)
return 0;
}
else if (conditions[0])
@ -415,7 +415,8 @@ gui_bar_check_conditions (struct t_gui_bar *bar,
if (pointers)
{
hashtable_set (pointers, "window", window);
hashtable_set (pointers, "buffer", window->buffer);
if (window)
hashtable_set (pointers, "buffer", window->buffer);
}
extra_vars = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
@ -429,7 +430,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar,
hashtable_set (extra_vars, "inactive",
(gui_current_window && (gui_current_window != window)) ? "1" : "0");
hashtable_set (extra_vars, "nicklist",
(window->buffer && window->buffer->nicklist) ? "1" : "0");
(window && window->buffer && window->buffer->nicklist) ? "1" : "0");
}
options = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,