From ece7d26f5297eef23dbb75ba95935f7e3ddb9274 Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 27 Jul 2016 12:43:57 +0100 Subject: [PATCH] Ensure the character cache is populated before accessing it --- Assets/Fungus/Narrative/Scripts/ConversationManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/Fungus/Narrative/Scripts/ConversationManager.cs b/Assets/Fungus/Narrative/Scripts/ConversationManager.cs index 9103c258..aaa88b3a 100644 --- a/Assets/Fungus/Narrative/Scripts/ConversationManager.cs +++ b/Assets/Fungus/Narrative/Scripts/ConversationManager.cs @@ -217,6 +217,11 @@ namespace Fungus // try to find the character param first, since we need to get its portrait int characterIndex = -1; + if (characters == null) + { + PopulateCharacterCache(); + } + for (int i = 0; item.Character == null && i < sayParams.Length; i++) { for (int j = 0; j < characters.Length; j++)