From 91781f8c582e9619ea282194f3d51ab0b5128a02 Mon Sep 17 00:00:00 2001 From: Hector Castelli Zacharias Date: Thu, 28 Jun 2018 20:09:44 -0400 Subject: [PATCH] Fixed issue when first creating a random sound component. --- Assets/Fungus/Scripts/Commands/PlayRandomSound.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs b/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs index e3b0f953..7b0b7ffb 100644 --- a/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs +++ b/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs @@ -66,7 +66,8 @@ namespace Fungus string sounds = "["; foreach (AudioClip ac in soundClip) { - sounds+=ac.name+" ,"; + if(ac!=null) + sounds+=ac.name+" ,"; } sounds = sounds.TrimEnd(' ', ','); sounds += "]";