Fix #113545: crash when trying to create panel with unknown type

Caused by 6a6dd392e2.
This commit is contained in:
Jacques Lucke
2023-10-11 16:07:52 +02:00
parent 7a8600f967
commit 449ded0258

View File

@@ -490,7 +490,9 @@ Panel *BKE_panel_new(PanelType *panel_type)
Panel *panel = MEM_cnew<Panel>(__func__);
panel->runtime = MEM_new<Panel_Runtime>(__func__);
panel->type = panel_type;
STRNCPY(panel->panelname, panel_type->idname);
if (panel_type) {
STRNCPY(panel->panelname, panel_type->idname);
}
return panel;
}