[gnome-games] retro-runner: Check if global save directory exists before copying
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro-runner: Check if global save directory exists before copying
- Date: Sat, 20 Mar 2021 16:55:39 +0000 (UTC)
commit 85d238efe647a14e5ff17ff31c660134986a6a72
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Mar 19 21:13:29 2021 +0500
retro-runner: Check if global save directory exists before copying
src/retro/retro-runner.vala | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 1e47d10b..6d8db470 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -223,9 +223,13 @@ public class Games.RetroRunner : Object, Runner {
snapshot.copy_save_dir_to (tmp_save_dir);
} else {
var path = get_fallback_save_directory_path ();
- var save_dir = File.new_for_path (Path.build_filename (path, "save-dir"));
+ var save_dir_path = Path.build_filename (path, "save-dir");
- FileOperations.copy_contents (save_dir, File.new_for_path (tmp_save_dir));
+ if (FileUtils.test (save_dir_path, FileTest.EXISTS)) {
+ var save_dir = File.new_for_path (save_dir_path);
+
+ FileOperations.copy_contents (save_dir, File.new_for_path
(tmp_save_dir));
+ }
}
prepare_core ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]