mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 09:31:14 +00:00
- treat non-existent arrays in the savegame as zero length.
This commit is contained in:
parent
32f0bbfe03
commit
e4bf84b015
1 changed files with 4 additions and 3 deletions
|
@ -927,9 +927,10 @@ unsigned FSerializer::GetSize(const char *group)
|
|||
{
|
||||
if (isWriting()) return -1; // we do not know this when writing.
|
||||
|
||||
const rapidjson::Value &val = r->mDoc[group];
|
||||
if (!val.IsArray()) return -1;
|
||||
return val.Size();
|
||||
const rapidjson::Value *val = r->FindKey(group);
|
||||
if (!val) return 0;
|
||||
if (!val->IsArray()) return -1;
|
||||
return val->Size();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue