[gnome-games] migrator: Bail if savestates dir already exists



commit 9a67736a0a24be2d67d5adf689bb157083b9ee39
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Mar 20 21:44:00 2020 +0500

    migrator: Bail if savestates dir already exists
    
    Prevent erroneous migrations on post-3.34 installs. Wow.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-games/issues/257

 src/core/migrator.vala | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/core/migrator.vala b/src/core/migrator.vala
index a9321d6f..44b73dbc 100644
--- a/src/core/migrator.vala
+++ b/src/core/migrator.vala
@@ -72,6 +72,11 @@ public class Games.Migrator : Object {
 
                // Create the savestates dir
                var savestates_dir = File.new_for_path (get_savestates_dir_path ());
+
+               // If the dir exists, we failed and there's already new data. Just bail
+               if (savestates_dir.query_exists ())
+                       return;
+
                savestates_dir.make_directory ();
 
                // Currently any game has only one snapshot file


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