diff --git a/Editor/Cluster_Drawer.cs b/Editor/Cluster_Drawer.cs index f31c3d6..7608867 100644 --- a/Editor/Cluster_Drawer.cs +++ b/Editor/Cluster_Drawer.cs @@ -40,13 +40,15 @@ namespace NanoBrain.Unity { } private void InitializeCluster(SerializedProperty property, ClusterView clusterView) { - if (clusterView.initialized) + if (property == null || property.serializedObject == null || clusterView.initialized) return; SerializedProperty prefabProp = property.FindPropertyRelative(nameof(Cluster.prefab)); UnityEngine.Object targetObject = property.serializedObject.targetObject; + if (targetObject == null) + return; - Debug.Log($"Instantiate new Cluster for {targetObject.name}"); + // Debug.Log($"Instantiate new Cluster for {targetObject.name}"); // This does not work properly yet it seems ClusterPrefab clusterPrefab = prefabProp.objectReferenceValue as ClusterPrefab;