Skip to content

Commit

Permalink
fix: Missing null check
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealLyonic committed Jan 18, 2025
1 parent 6720710 commit 6689fc0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Nautilus/Utility/MaterialUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ public static void ApplyUBERShader(Material material, float shininess, float spe
/// <param name="baseGamePrefab">The base-game prefab which contains the material(s) you want to apply.</param>
public static void ApplyGameMaterials(GameObject customPrefab, GameObject baseGamePrefab)
{
if (customPrefab is null || baseGamePrefab is null)
{
InternalLogger.Error("Couldn't apply game materials because a null object was passed into the method.");
return;
}

var customRenderers = customPrefab.GetComponentsInChildren<Renderer>(true);

for (int i = 0; i < customRenderers.Length; i++)
Expand Down

0 comments on commit 6689fc0

Please sign in to comment.