From 105359e54a31bbdd66c3ba42ea06f0b9abf981b4 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 17 May 2019 09:45:11 +0100 Subject: [PATCH] FIX: Only delete theme folder if it has been created If an exception is raised before the folder is created, then this `ensure` block is still run --- lib/theme_store/git_importer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/theme_store/git_importer.rb b/lib/theme_store/git_importer.rb index f81e95e0402..6d8cee3c87d 100644 --- a/lib/theme_store/git_importer.rb +++ b/lib/theme_store/git_importer.rb @@ -44,7 +44,7 @@ class ThemeStore::GitImporter return Discourse::Utils.execute_command("git", "diff", "--staged") end ensure - FileUtils.rm_rf local_temp_folder + FileUtils.rm_rf local_temp_folder if local_temp_folder end def commits_since(hash)