Test datadir in conf file exists

This commit is contained in:
MeshCollider 2017-12-06 00:24:06 +13:00
parent 91eeaa0335
commit 529b866759

View file

@ -639,6 +639,9 @@ void ArgsManager::ReadConfigFile(const std::string& confPath)
} }
// If datadir is changed in .conf file: // If datadir is changed in .conf file:
ClearDatadirCache(); ClearDatadirCache();
if (!fs::is_directory(GetDataDir(false))) {
throw std::runtime_error(strprintf("specified data directory \"%s\" does not exist.", gArgs.GetArg("-datadir", "").c_str()));
}
} }
#ifndef WIN32 #ifndef WIN32