From d4384422f49d03aed394a9da9ecd3be4da304cb5 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 22 Feb 2016 21:27:03 +0200 Subject: [PATCH] HTTP repository: replace an assert. - Torsten is seeing this on his setup. --- simgear/io/HTTPRepository.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simgear/io/HTTPRepository.cxx b/simgear/io/HTTPRepository.cxx index fc0913df..cd354d1c 100644 --- a/simgear/io/HTTPRepository.cxx +++ b/simgear/io/HTTPRepository.cxx @@ -633,7 +633,10 @@ HTTPRepository::failure() const // dir index data has changed, so write to disk and update // the hash accordingly std::ofstream of(pathInRepo().c_str(), std::ios::trunc | std::ios::out); - assert(of.is_open()); + if (!of.is_open()) { + throw sg_io_exception("Failed to open directory index file for writing", pathInRepo().c_str()); + } + of.write(body.data(), body.size()); of.close(); directory->dirIndexUpdated(hash); -- 2.39.5