aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/screen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/screen.c b/src/screen.c
index a55b2cf82..0c59d6940 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -140,18 +140,18 @@ switch_screen_mode(gint id, mpdclient_t *c)
if( id == screens[screen.mode].id )
return;
+ new_mode = lookup_mode(id);
+ if (new_mode < 0)
+ return;
+
/* close the old mode */
if (mode_fn->close != NULL)
mode_fn->close();
/* get functions for the new mode */
- new_mode = lookup_mode(id);
- if (new_mode >= 0) {
- D("switch_screen(%s)\n", screens[new_mode].name );
- mode_fn = screens[new_mode].functions;
- screen.mode = new_mode;
- }
-
+ D("switch_screen(%s)\n", screens[new_mode].name );
+ mode_fn = screens[new_mode].functions;
+ screen.mode = new_mode;
screen.painted = 0;
/* open the new mode */