Fix crash when loading empty managed object data
This commit is contained in:
@@ -88,7 +88,6 @@ void ManagedSerialization::Deserialize(ISerializable::DeserializeStream& stream,
|
|||||||
{
|
{
|
||||||
if (!object)
|
if (!object)
|
||||||
return;
|
return;
|
||||||
ASSERT(stream.IsObject());
|
|
||||||
|
|
||||||
// Get serialized data
|
// Get serialized data
|
||||||
rapidjson_flax::StringBuffer buffer;
|
rapidjson_flax::StringBuffer buffer;
|
||||||
@@ -100,10 +99,10 @@ void ManagedSerialization::Deserialize(ISerializable::DeserializeStream& stream,
|
|||||||
|
|
||||||
void ManagedSerialization::Deserialize(const StringAnsiView& data, MonoObject* object)
|
void ManagedSerialization::Deserialize(const StringAnsiView& data, MonoObject* object)
|
||||||
{
|
{
|
||||||
if (!object)
|
|
||||||
return;
|
|
||||||
const char* str = data.Get();
|
const char* str = data.Get();
|
||||||
const int32 len = data.Length();
|
const int32 len = data.Length();
|
||||||
|
if (!object || len == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
// Skip case {} to improve performance
|
// Skip case {} to improve performance
|
||||||
if (StringUtils::Compare(str, "{}") == 0)
|
if (StringUtils::Compare(str, "{}") == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user