aboutsummaryrefslogtreecommitdiff
path: root/swaybar/bar.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-10-23 10:50:36 +0200
committerGitHub <noreply@github.com>2018-10-23 10:50:36 +0200
commit970501f05e8a1835b880953888ad3022fb2e9ada (patch)
tree76c055bb612b6914c42b8e78e6449b86b4efdf2a /swaybar/bar.c
parenta5cb4cca15273f20a218cb96fc4da26e4e8da72c (diff)
parent851b442f73a164c7e97cdefacca44a4517076a2c (diff)
Merge pull request #2940 from RyanDwyer/fix-swaybar-crash
Fix swaybar crash when there's no status_command
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c10
1 files 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;