minor filesystem fixups

This commit is contained in:
2021-03-07 15:39:36 +01:00
parent 4f859bad2e
commit 66c7958084
3 changed files with 8 additions and 4 deletions

View File

@ -296,11 +296,13 @@ nlohmann::json FilesystemService::readJson(fs_file_t file) const {
std::string buffer;
readString(file, buffer);
return nlohmann::json::parse(buffer);
// disable exeptions
// TODO: use callback instead of readString()
return nlohmann::json::parse(buffer, nullptr, false);
}
nlohmann::json FilesystemService::readJson(const char* filepath) const {
if (!exists(filepath)) {
if (!isFile(filepath)) {
return {};
}