[gnome-games] retro-runner: Add a missing null check in start()
- From: Alexander Mikhaylenko <alexm src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-games] retro-runner: Add a missing null check in start()
 
- Date: Sun, 18 Aug 2019 14:10:51 +0000 (UTC)
 
commit 227ae857a18927268c469f3be4f549c15ef09035
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Aug 18 19:09:34 2019 +0500
    retro-runner: Add a missing null check in start()
    
    Check whether the savestate is null before loading extra metadata.
    
    Avoid a runtime warning when starting a game with no savestates.
 src/retro/retro-runner.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index fd2e980b..f5e36d33 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -242,7 +242,8 @@ public class Games.RetroRunner : Object, Runner {
 
                loop.start ();
 
-               load_extra_savestate_metadata (latest_savestate);
+               if (latest_savestate != null)
+                       load_extra_savestate_metadata (latest_savestate);
 
                running = true;
        }
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]