fixed crash when enum in property grid is empty (e.g. ambient sound with no clips)

This commit is contained in:
Mikulas Florek 2020-06-05 19:00:26 +02:00
parent 0d74a20860
commit f0fa7f302d

View file

@ -203,7 +203,7 @@ struct GridUIVisitor final : Reflection::IPropertyVisitor
const int count = enum_attr->count(cmp);
const char* preview = enum_attr->name(cmp, value);
const char* preview = count ? enum_attr->name(cmp, value) : "";
ImGuiEx::Label(prop.name);
ImGui::PushID(prop.name);
if (ImGui::BeginCombo("##v", preview)) {