diff --git a/simgear/io/HTTPRepository.cxx b/simgear/io/HTTPRepository.cxx index 477232ea..be2385d6 100644 --- a/simgear/io/HTTPRepository.cxx +++ b/simgear/io/HTTPRepository.cxx @@ -631,7 +631,10 @@ HTTPRepository::failure() const virtual void onFail() { file.reset(); - pathInRepo.remove(); + if (pathInRepo.exists()) { + pathInRepo.remove(); + } + if (_directory) { _directory->didFailToUpdateFile(fileName, AbstractRepository::REPO_ERROR_SOCKET); _directory->repository()->finishedRequest(this);