diff --git a/src/backend/git.cpp b/src/backend/git.cpp index d35960cf..60a7ae2c 100644 --- a/src/backend/git.cpp +++ b/src/backend/git.cpp @@ -68,10 +68,18 @@ namespace loot { buf({0}) {} ~git_handler() { - string path(git_repository_path(repo)); + string path; + if (repo != nullptr) + path = git_repository_path(repo); + free(); - FixRepoPermissions(path); + if (!path.empty()) { + try { + FixRepoPermissions(path); + } + catch (exception&) {} + } } void free() {