diff options
-rw-r--r-- | ChangeLog.asciidoc | 2 | ||||
-rw-r--r-- | src/gui/gui-bar.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 511853dd8..5c8a6913e 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -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 diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 121041422..f71bc8147 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -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, |