mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Galaxy: Add some checks to GalaxyConfig class
Check that json contains the node before trying to get value
This commit is contained in:
parent
706158d595
commit
c9b6ea4a52
@ -75,14 +75,20 @@ class GalaxyConfig
|
|||||||
|
|
||||||
std::string getAccessToken()
|
std::string getAccessToken()
|
||||||
{
|
{
|
||||||
|
std:: string access_token;
|
||||||
std::unique_lock<std::mutex> lock(m);
|
std::unique_lock<std::mutex> lock(m);
|
||||||
return this->token_json["access_token"].asString();
|
if (this->token_json.isMember("access_token"))
|
||||||
|
access_token = this->token_json["access_token"].asString();
|
||||||
|
return access_token;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getRefreshToken()
|
std::string getRefreshToken()
|
||||||
{
|
{
|
||||||
|
std::string refresh_token;
|
||||||
std::unique_lock<std::mutex> lock(m);
|
std::unique_lock<std::mutex> lock(m);
|
||||||
return this->token_json["refresh_token"].asString();
|
if (this->token_json.isMember("refresh_token"))
|
||||||
|
refresh_token = this->token_json["refresh_token"].asString();
|
||||||
|
return refresh_token;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value getJSON()
|
Json::Value getJSON()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user