[gnome-games] database-game: Fallback to DummyPlatform if it's not known



commit 0f3d4658e57dad955c1b58d12717b62612ce7532
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Feb 19 15:46:01 2020 +0500

    database-game: Fallback to DummyPlatform if it's not known
    
    Currently when running Sharp X68000 support branch and then running master,
    games with the Sharp X68000 platform cause errors because platform is null.
    
    To mitigate that, use DummyPlatform for these games, so that they show up
    as unknown before the loading completes and they are cleared up.

 src/database/database-game.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/database/database-game.vala b/src/database/database-game.vala
index 9454a39a..ea096317 100644
--- a/src/database/database-game.vala
+++ b/src/database/database-game.vala
@@ -17,6 +17,9 @@ public class Games.DatabaseGame : Object, Game {
                game_title = title;
                game_platform = PlatformRegister.get_register ().get_platform (platform);
 
+               if (game_platform == null)
+                       game_platform = new DummyPlatform ();
+
                if (media_set != null)
                        game_media_set = new MediaSet.parse (new Variant.parsed (media_set));
        }


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