[gnome-games/gnome-3-36] migrator: Bail if savestates dir already exists
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/gnome-3-36] migrator: Bail if savestates dir already exists
- Date: Fri, 20 Mar 2020 16:47:52 +0000 (UTC)
commit c677e83fc831f7e0e8d431dbdd196b1a6db677c2
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]