editor: don't crash on selecting object when EditorBase doesn't have member EditorProps

This crash happened for me in a custom scenario but with unmodified original objects. No idea why, but it seemed defective anyway.
directional-lights
David Dormagen 2016-10-23 18:47:11 +02:00
parent 8fb8be9cec
commit c2f391e565
1 changed files with 3 additions and 2 deletions

View File

@ -2760,9 +2760,10 @@ int32_t C4ConsoleQtPropListModel::UpdateValuePropList(C4PropList *target_proplis
if (obj)
{
C4Def *editor_base = C4Id2Def(C4ID::EditorBase);
if (editor_base)
C4PropList *info_editorprops = nullptr;
if (editor_base && (info_editorprops = editor_base->GetPropertyPropList(P_EditorProps)))
{
C4PropList *info_editorprops = editor_base->GetPropertyPropList(P_EditorProps);
if (AddPropertyGroup(info_editorprops, num_groups, LoadResStr("IDS_CNS_OBJECT"), target_proplist, base_obj, nullptr, nullptr))
++num_groups;
}