Skip to content

Commit 05d8a79

Browse files
authored
Fix a reference issue in ClippingPrimitive (#10627)
1 parent 808c439 commit 05d8a79

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Assets/MRTK/Core/Utilities/StandardShader/ClippingPrimitive.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ public bool CacheSharedMaterialsFromRenderer
131131

132132
private Material[] AcquireMaterials(Renderer renderer, bool instance = true)
133133
{
134+
if (renderer == null)
135+
{
136+
return null;
137+
}
138+
134139
if (applyToSharedMaterial)
135140
{
136141
return renderer.sharedMaterials;

0 commit comments

Comments
 (0)