mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #4501 from def-/pr-crash
Fix crash in GetSaves (fixes #4500)
This commit is contained in:
commit
0073f6ce89
|
@ -1641,11 +1641,11 @@ bool CScoreWorker::GetSaves(IDbConnection *pSqlServer, const ISqlData *pGameData
|
|||
if(!End)
|
||||
{
|
||||
int NumSaves = pSqlServer->GetInt(1);
|
||||
int Ago = pSqlServer->GetInt(2);
|
||||
char aAgoString[40] = "\0";
|
||||
char aLastSavedString[60] = "\0";
|
||||
if(Ago)
|
||||
if(!pSqlServer->IsNull(2))
|
||||
{
|
||||
int Ago = pSqlServer->GetInt(2);
|
||||
char aAgoString[40] = "\0";
|
||||
sqlstr::AgoTimeToString(Ago, aAgoString, sizeof(aAgoString));
|
||||
str_format(aLastSavedString, sizeof(aLastSavedString), ", last saved %s ago", aAgoString);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue