audiod: Make writer_cleanup() accept NULL pointer argument.
[paraslash.git] / audiod.c
index 456813b..322ce3b 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -340,8 +340,12 @@ static void close_receiver(int slot_num)
 
 static void writer_cleanup(struct writer_node *wn)
 {
-       struct writer *w = writers + wn->writer_num;
+       struct writer *w;
 
+       if (!wn)
+               return;
+       w = writers + wn->writer_num;
+       PARA_INFO_LOG("closing %s\n", writer_names[wn->writer_num]);
        w->close(wn);
        btr_free_node(wn->btrn);
 }