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 <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-10-17 08:03:57 -04:00
parent 59b2c854e7
commit 01927cf806
1 changed files with 1 additions and 1 deletions

View File

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