mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
Properly handle leaderboard name being NULL (#167)
This commit is contained in:
parent
f041b95c86
commit
c5f50ddb32
@ -591,6 +591,12 @@ SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderb
|
|||||||
{
|
{
|
||||||
PRINT_DEBUG("FindOrCreateLeaderboard %s\n", pchLeaderboardName);
|
PRINT_DEBUG("FindOrCreateLeaderboard %s\n", pchLeaderboardName);
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
|
if (!pchLeaderboardName) {
|
||||||
|
LeaderboardFindResult_t data;
|
||||||
|
data.m_hSteamLeaderboard = 0;
|
||||||
|
data.m_bLeaderboardFound = 0;
|
||||||
|
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int leader = find_leaderboard(pchLeaderboardName);
|
unsigned int leader = find_leaderboard(pchLeaderboardName);
|
||||||
if (!leader) {
|
if (!leader) {
|
||||||
@ -616,6 +622,12 @@ SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName )
|
|||||||
{
|
{
|
||||||
PRINT_DEBUG("FindLeaderboard %s\n", pchLeaderboardName);
|
PRINT_DEBUG("FindLeaderboard %s\n", pchLeaderboardName);
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
|
if (!pchLeaderboardName) {
|
||||||
|
LeaderboardFindResult_t data;
|
||||||
|
data.m_hSteamLeaderboard = 0;
|
||||||
|
data.m_bLeaderboardFound = 0;
|
||||||
|
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
auto settings_Leaderboards = settings->getLeaderboards();
|
auto settings_Leaderboards = settings->getLeaderboards();
|
||||||
if (settings_Leaderboards.count(pchLeaderboardName)) {
|
if (settings_Leaderboards.count(pchLeaderboardName)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user