From 5da773c74830fcd67090b0fedea4e0acf6c194b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Wed, 15 May 2024 13:42:22 +0200 Subject: [PATCH] Fix NRE when filtering types and exludedTypes is null --- Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs b/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs index c6d7ef4..9b99813 100644 --- a/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs +++ b/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs @@ -163,7 +163,7 @@ where type.IsVisible && isValid where (FilterConstraintOverride == null || FilterConstraintOverride.Invoke(type)) && (filter == null || filter.IsConstraintSatisfied(type)) where excludedTypes == null || !excludedTypes.Contains(type) - where !type.GetInterfaces().Any(interfaceType => excludedTypes.Contains(interfaceType)) + where !type.GetInterfaces().Any(interfaceType => excludedTypes != null && excludedTypes.Contains(interfaceType)) select type); }