gui/queue: Check for gq_queue before dereferencing it

Otherwise Ocarina will crash.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-08-29 07:55:15 -04:00
parent 20f10c163d
commit 1d02024505
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ void __queue_random(GtkToggleButton *button, gpointer data)
__queue_toggle_flag(gtk_toggle_button_get_active(button),
gtk_button_get_image(GTK_BUTTON(button)),
Q_RANDOM);
if (gq_queue->gq_playlist) {
if (gq_queue && gq_queue->gq_playlist) {
playlist_set_random(gq_queue->gq_playlist->pl_type,
gq_queue->gq_playlist->pl_name,
gtk_toggle_button_get_active(button));