From b09a34b7fc602ed15260bc9c1d92d134df3de6b1 Mon Sep 17 00:00:00 2001 From: Chris Gregan Date: Thu, 5 May 2016 17:54:57 +0100 Subject: [PATCH] Null check in SpriteFader --- Assets/Fungus/Sprite/Scripts/SpriteFader.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/Fungus/Sprite/Scripts/SpriteFader.cs b/Assets/Fungus/Sprite/Scripts/SpriteFader.cs index 416fbdf5..dfcd49b2 100644 --- a/Assets/Fungus/Sprite/Scripts/SpriteFader.cs +++ b/Assets/Fungus/Sprite/Scripts/SpriteFader.cs @@ -47,6 +47,7 @@ namespace Fungus // Destroy any existing fader component SpriteFader oldSpriteFader = spriteRenderer.GetComponent(); + if (oldSpriteFader != null) { Destroy(oldSpriteFader); }