diff --git a/Assets/MissingReferencesFinder/Editor/MissingReferencesFinder.cs b/Assets/MissingReferencesFinder/Editor/MissingReferencesFinder.cs index 2414a36..8bfd2e0 100644 --- a/Assets/MissingReferencesFinder/Editor/MissingReferencesFinder.cs +++ b/Assets/MissingReferencesFinder/Editor/MissingReferencesFinder.cs @@ -61,6 +61,12 @@ private static void FindMissingReferences(string context, GameObject[] gameObjec foreach (var component in components) { + if (component == null) + { + Debug.LogErrorFormat(go, $"Missing Component / Script on GameObject: {1}", GetFullPath(go)); + continue; + } + // Missing components will be null, we can't find their type, etc. if (!component) { @@ -119,4 +125,4 @@ private static string GetFullPath(GameObject go) ? go.name : GetFullPath(go.transform.parent.gameObject) + "/" + go.name; } -} \ No newline at end of file +}