Skip to content

Commit 57f6237

Browse files
committed
Added null check when adding drawers in InspectorPlus.
1 parent 3a458d2 commit 57f6237

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Assets/Script Tester/Editor/InspectorPlus.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ void OnSelectionChange() {
141141
}
142142

143143
InspectorDrawer[] CreateDrawers(int instanceID) {
144-
var ret = new List<InspectorDrawer>();
145144
var target = EditorUtility.InstanceIDToObject(instanceID);
145+
if (target == null)
146+
return new InspectorDrawer[0];
147+
var ret = new List<InspectorDrawer>();
146148
try {
147149
ret.Add(CreateDrawer(target, true));
148150
} catch (Exception ex) {

0 commit comments

Comments
 (0)