Skip to content

Commit ce4c9e0

Browse files
committed
Null check for render texture, before attempting to release.
1 parent a3e89e4 commit ce4c9e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PixelCamera.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ protected void SetupCamera()
261261
fallbackMaterial.SetTexture("_MainTex", null);
262262
if (advancedSettings != null && advancedSettings.cameraMaterial != null)
263263
advancedSettings.cameraMaterial.SetTexture("_MainTex", null);
264-
renderTexture.Release();
264+
if (renderTexture != null)
265+
renderTexture.Release();
265266

266267
// Create new render texture
267268
renderTexture = new RenderTexture(pixelRenderSize[0], pixelRenderSize[1], 0)

0 commit comments

Comments
 (0)