Fix error when model is missing in Editor for prefab editor

#1354
This commit is contained in:
Wojtek Figat
2023-09-11 21:36:36 +02:00
parent b7cf0d4420
commit 0a5f983ff4

View File

@@ -39,6 +39,8 @@ namespace FlaxEditor.CustomEditors.Editors
_entryIndex = entryIndex;
_modelInstance = modelInstance;
var slots = modelInstance.MaterialSlots;
if (slots == null || entryIndex >= slots.Length)
return;
if (entry.Material == slots[entryIndex].Material)
{
// Ensure that entry with default material set is set back to null