mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-04-22 23:50:58 +00:00
fix crash with saving null Dictionary
This commit is contained in:
parent
ebc6fcccd7
commit
81744d5b7a
1 changed files with 6 additions and 1 deletions
|
@ -2129,6 +2129,11 @@ FString DictionaryToString(const Dictionary &dict)
|
|||
|
||||
Dictionary *DictionaryFromString(const FString &string)
|
||||
{
|
||||
if (string.IsEmpty())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Dictionary *const dict = new Dictionary;
|
||||
|
||||
rapidjson::Document doc;
|
||||
|
@ -2158,7 +2163,7 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, Dictionary
|
|||
{
|
||||
if (arc.isWriting())
|
||||
{
|
||||
FString contents { DictionaryToString(*dict) };
|
||||
FString contents { dict ? DictionaryToString(*dict) : "" };
|
||||
return arc(key, contents);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue