Fixed bug where lists failed to be deserialized correctly

This commit is contained in:
Kah Wei 2022-11-24 23:27:13 +08:00
parent 72c8a504c5
commit 9ada998151
2 changed files with 17 additions and 1 deletions

View File

@ -279,7 +279,15 @@ namespace SHADE
for (int i = 0; i < LIST_SIZE; ++i)
{
// Create the object
System::Object^ obj = System::Activator::CreateInstance(elemType);
System::Object^ obj;
if (elemType == System::String::typeid)
{
obj = gcnew System::String("");
}
else
{
obj = System::Activator::CreateInstance(elemType);
}
// Set it's value
if (varAssignYaml(obj, node[i]))

View File

@ -167,6 +167,10 @@ namespace SHADE
{
valueObj = 0;
}
else
{
return false;
}
}
else
{
@ -181,6 +185,10 @@ namespace SHADE
valueObj = FieldType();
}
}
else
{
return false;
}
}
}