From 851b442f73a164c7e97cdefacca44a4517076a2c Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 23 Oct 2018 18:38:01 +1000 Subject: [PATCH] Fix swaybar crash when there's no status_command --- swaybar/bar.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/swaybar/bar.c b/swaybar/bar.c index a34e4ad5..1439a11c 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -155,10 +155,12 @@ bool determine_bar_visibility(struct swaybar *bar, bool moving_layer) { if (visible != bar->visible) { bar->visible = visible; - wlr_log(WLR_DEBUG, "Sending %s signal to status command", - visible ? "cont" : "stop"); - kill(bar->status->pid, - visible ? bar->status->cont_signal : bar->status->stop_signal); + if (bar->status) { + wlr_log(WLR_DEBUG, "Sending %s signal to status command", + visible ? "cont" : "stop"); + kill(bar->status->pid, visible ? + bar->status->cont_signal : bar->status->stop_signal); + } } return visible;