Merge pull request #2940 from RyanDwyer/fix-swaybar-crash

Fix swaybar crash when there's no status_command
This commit is contained in:
emersion 2018-10-23 10:50:36 +02:00 committed by GitHub
commit 970501f05e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;