Skip to content

Commit

Permalink
FIx GPSS Download Codes
Browse files Browse the repository at this point in the history
  • Loading branch information
FM1337 committed Apr 3, 2024
1 parent 18d808b commit dd9b561
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions 3ds/source/gui/screen/CloudScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,13 +928,23 @@ void CloudScreen::shareReceive()
}

nlohmann::json retJson = nlohmann::json::parse(retData, nullptr, false);

std::string generation = "";
if (retJson.contains("generation")) {
if(retJson["generation"].is_string()) {
generation = retJson["generation"].get<std::string>();
} else if(retJson["generation"].is_number()) {
// convert the number to a string
generation = std::to_string(retJson["generation"].get<int>());
}
}


if (retJson.is_object() && retJson.contains("generation") &&
retJson["generation"].is_string() && retJson.contains("pokemon") &&
if (retJson.is_object() && generation != "" && retJson.contains("pokemon") &&
retJson["pokemon"].is_string())
{
pksm::Generation gen =
pksm::Generation::fromString(retJson["generation"].get_ref<std::string&>());
pksm::Generation::fromString(generation);

auto retData = base64_decode(retJson["pokemon"].get_ref<std::string&>());

Expand Down

0 comments on commit dd9b561

Please sign in to comment.