From 01927cf80650c4666f5981a36bc95633b18daed6 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Mon, 17 Oct 2016 08:03:57 -0400 Subject: [PATCH] gui/model: Don't add tracks if queue_model is NULL Otherwise we will crash with a memory error. This only seems to be a problem when Ocarina is started up after creating a user playlist. Fixes #99: Ocarina crashes during startup with user playlists Signed-off-by: Anna Schumaker --- gui/model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/model.c b/gui/model.c index 23f1978a..cdd6bf17 100644 --- a/gui/model.c +++ b/gui/model.c @@ -285,7 +285,7 @@ void gui_queue_model_add(struct queue *queue, unsigned int row) GtkTreePath *path; GtkTreeIter iter; - if (queue != queue_model->gqm_queue) + if (!queue_model || queue != queue_model->gqm_queue) return; path = gtk_tree_path_new_from_indices(row, -1);