Skip to content

Commit

Permalink
Fix legendary version retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
Bakkes committed Jan 23, 2023
1 parent 4287961 commit e3f67f6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions BakkesModInjectorC++/BakkesModInstallation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,18 @@ std::vector<std::string> BakkesModInstallation::GetEpicVersion()
{
try
{
std::string versionNumber = js["Sugar"]["version"].As<json::String>().Value();
LOG_LINE(INFO, "Found Epic version " << versionNumber);
if (!versionNumber.empty())
if (auto sugar = js.find("Sugar"); sugar != js.end())
{
epicVersions.push_back(versionNumber);
auto& sugarValue = sugar.value();
std::string versionNumber = sugarValue.value("version", "");
LOG_LINE(INFO, "Found Epic version " << versionNumber);

if (!versionNumber.empty())
{
epicVersions.push_back(versionNumber);
}
}

}
catch (...)
{
Expand Down

0 comments on commit e3f67f6

Please sign in to comment.