mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- treat non-existent arrays in the savegame as zero length.
This commit is contained in:
parent
cad43e431c
commit
496dd4ee68
1 changed files with 4 additions and 3 deletions
|
@ -920,9 +920,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