]> git.mxchange.org Git - simgear.git/commitdiff
HTTP repository: replace an assert.
authorJames Turner <zakalawe@mac.com>
Mon, 22 Feb 2016 19:27:03 +0000 (21:27 +0200)
committerJames Turner <zakalawe@mac.com>
Mon, 22 Feb 2016 19:27:03 +0000 (21:27 +0200)
- Torsten is seeing this on his setup.

simgear/io/HTTPRepository.cxx

index fc0913dfb4aab997cb3ca111e1a817d9dcd8b4e7..cd354d1cead7ed5619769f266ab85ac06a8d8b6b 100644 (file)
@@ -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);