[gnome-games] retro-runner: Don't try to set current media if there's no media



commit 1fbaf494fb6070103e35595a14d221f4d1c28084
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Feb 1 20:55:45 2020 +0500

    retro-runner: Don't try to set current media if there's no media
    
    Prevent a runtime error.

 src/retro/retro-runner.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 951e389b..23b0800c 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -352,7 +352,9 @@ public class Games.RetroRunner : Object, Runner {
 
                core.set_medias (medias_uris);
                core.boot ();
-               core.set_current_media (media_set.selected_media_number);
+
+               if (medias_uris.length > 0)
+                       core.set_current_media (media_set.selected_media_number);
        }
 
        public void pause () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]