From 8574943784da5ce5e910ddf805423eed93996cad Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sun, 29 Oct 2017 23:29:59 +0900 Subject: gtk: fixed crash when hitting F7 before file loaded --- gtk/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/main.c b/gtk/main.c index c941896..eafc9b3 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -433,9 +433,11 @@ static gboolean key_press_cb(GtkWidget *w, } break; case GDK_KEY_F7: - g.sound_paused ^= 1; - g.work.paused = g.sound_paused; - g.ss->pause(g.ss, g.sound_paused, 0); + if (g.ss) { + g.sound_paused ^= 1; + g.work.paused = g.sound_paused; + g.ss->pause(g.ss, g.sound_paused, 0); + } break; case GDK_KEY_F11: if (shift) { -- cgit v1.2.3