From 9c42557b66d29574784ba26b34a50356c7894a60 Mon Sep 17 00:00:00 2001 From: crondog Date: Thu, 31 Mar 2016 20:50:07 +1100 Subject: Stop swaybar crashing without args --- swaybar/bar.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/swaybar/bar.c b/swaybar/bar.c index b6329123..94ed9dac 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -199,9 +199,17 @@ static void terminate_status_command(pid_t pid) { } void bar_teardown(struct bar *bar) { - free_config(bar->config); - free_outputs(bar->outputs); - free_status_line(bar->status); + if (bar->config) { + free_config(bar->config); + } + + if (bar->outputs) { + free_outputs(bar->outputs); + } + + if (bar->status) { + free_status_line(bar->status); + } /* close sockets/pipes */ if (bar->status_read_fd) { -- cgit v1.2.3