Fixed crash from adding an element to a list of strings in the script inspector
This commit is contained in:
parent
7c58c9a23d
commit
72c8a504c5
|
@ -200,7 +200,16 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
if (SHEditorUI::Button("Add Item"))
|
if (SHEditorUI::Button("Add Item"))
|
||||||
{
|
{
|
||||||
System::Object^ obj = System::Activator::CreateInstance(listType);
|
System::Object^ obj;
|
||||||
|
if (listType == System::String::typeid)
|
||||||
|
{
|
||||||
|
// Special case for string
|
||||||
|
obj = gcnew System::String("");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj = System::Activator::CreateInstance(listType);
|
||||||
|
}
|
||||||
iList->Add(obj);
|
iList->Add(obj);
|
||||||
registerUndoListAddAction(listType, iList, iList->Count - 1, obj);
|
registerUndoListAddAction(listType, iList, iList->Count - 1, obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue