Dont try to parse empty settings.json

This commit is contained in:
jonahquark 2020-05-20 19:27:52 +01:00
parent 0168bb17ab
commit 8d715e6bfc

View file

@ -90,7 +90,7 @@ void Config::init(const std::string& root_directory, const std::string& user, co
try
{
ifstream ifs(filename_, std::ifstream::in);
if (ifs.good())
if ((ifs.good()) && (ifs.peek() != std::ifstream::traits_type::eof()))
{
json j;
ifs >> j;