From 8ca5136bb7dfa2a312276c7bfe00baee9085e03c Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Sat, 6 Apr 2024 21:58:54 -0700 Subject: [PATCH] Don't raise an error when initial path doesn't exist in game.move --- lutris/game.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lutris/game.py b/lutris/game.py index 6766c7bd6..6ddedca45 100644 --- a/lutris/game.py +++ b/lutris/game.py @@ -1040,15 +1040,6 @@ class Game(GObject.Object): old_location = self.directory target_directory = self._get_move_target_directory(new_location) - # Raise errors before actually changing anything! - if not old_location: - raise InvalidGameMoveError(_("The game has no location currently set, so it can't be moved.")) - - if not system.path_exists(old_location): - raise InvalidGameMoveError( - _("The location '%s' does not exist, perhaps the files have already been moved?") % old_location - ) - if new_location.startswith(old_location): raise InvalidGameMoveError( _("Lutris can't move '%s' to a location inside of itself, '%s'.") % (old_location, new_location) @@ -1066,6 +1057,10 @@ class Game(GObject.Object): with open(self.config.game_config_path, "w", encoding="utf-8") as config_file: config_file.write(new_config) + if not system.path_exists(old_location): + logger.warning("Initial location %s does not exist, files may have already been moved.") + return + try: shutil.move(old_location, new_location) except OSError as ex: