Skip to content

Commit

Permalink
Don't try to open a nonexistent save_index file
Browse files Browse the repository at this point in the history
As requested in #2539.
  • Loading branch information
Vultraz committed Feb 22, 2018
1 parent 475ba8c commit 691f925
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/save_index.cpp
Expand Up @@ -133,9 +133,12 @@ config& save_index_class::data(const std::string& name)

config& save_index_class::data()
{
if(loaded_ == false) {
const std::string si_file = filesystem::get_save_index_file();

// Don't try to load the file if it doesn't exist.
if(loaded_ == false && filesystem::file_exists(si_file)) {
try {
filesystem::scoped_istream stream = filesystem::istream_file(filesystem::get_save_index_file());
filesystem::scoped_istream stream = filesystem::istream_file(si_file);
try {
read_gz(data_, *stream);
} catch(boost::iostreams::gzip_error&) {
Expand Down

0 comments on commit 691f925

Please sign in to comment.