summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-01-23 21:21:39 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-01-23 21:21:39 +0100
commited9e146e46f157895954b807a332ef6b19044e8f (patch)
tree7b903b0c33853ef9ae798956e4fa2b80fa0afa42 /src
parenta617cd857a332e1ba2dfc0918e4269804b444106 (diff)
downloadweechat-ed9e146e46f157895954b807a332ef6b19044e8f.zip
core: fix crash when a root bar has conditions different from active/inactive/nicklist (closes #317)
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui-bar.c7
1 files changed, 4 insertions, 3 deletions
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,