From 529b8667599ad74f6dae639b889d22e907353070 Mon Sep 17 00:00:00 2001 From: MeshCollider Date: Wed, 6 Dec 2017 00:24:06 +1300 Subject: [PATCH] Test datadir in conf file exists --- src/util.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 6631c236f1..1aa18c73b3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -639,6 +639,9 @@ void ArgsManager::ReadConfigFile(const std::string& confPath) } // If datadir is changed in .conf file: 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