Skip to content

Commit

Permalink
Ensure GetMaterialsFromGameObject returns no null values. (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColorlessColor authored Oct 12, 2024
1 parent b38e3dd commit f0d29a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Assets/lilToon/External/Editor/VRChatModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ private static Material[] GetMaterialsFromGameObject(GameObject gameObject)
{
materials.AddRange(renderer.sharedMaterials);
}
return materials.ToArray();
// sharedMaterials may a Material[null] on Unity 2022.3.22f1 if there is no material on a renderer.
return materials.Where(m => m != null).ToArray();
}

private static AnimationClip[] GetAnimationClipsFromGameObject(GameObject gameObject)
Expand Down

0 comments on commit f0d29a1

Please sign in to comment.