From 4c01a6f073cd3ed6c3def56ec8796cb76df936ff Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 23 Oct 2014 21:38:15 +0100 Subject: [PATCH] Fixed crash at end of masterlist update. Was due to trying to get the repo path from a closed repo handle. --- src/backend/git.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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() {