forked from rosebudai/OpenRCT2-Web
Apply more code review comments
This commit is contained in:
1 parent
d480fb8daa
commit
2f525e0539
11 files changed
+76
-67
No files matched your search
@@ -885,15 +885,19 @@ void ScriptEngine::LoadSharedStorage()
|
||||
auto path = _env.GetFilePath(PATHID::PLUGIN_STORE);
|
||||
try
|
||||
{
|
||||
auto data = File::ReadAllBytes(path);
|
||||
auto result = DuktapeTryParseJson(_context, std::string_view((const char*)data.data(), data.size()));
|
||||
if (result)
|
||||
if (File::Exists(path))
|
||||
{
|
||||
_sharedStorage = std::move(*result);
|
||||
auto data = File::ReadAllBytes(path);
|
||||
auto result = DuktapeTryParseJson(_context, std::string_view((const char*)data.data(), data.size()));
|
||||
if (result)
|
||||
{
|
||||
_sharedStorage = std::move(*result);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
fprintf(stderr, "Unable to read '%s'\n", path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user