From 9bd1b806a66e360a18f95a7d4bcf4df784b67acf Mon Sep 17 00:00:00 2001 From: lealeelu Date: Fri, 5 Aug 2016 10:00:07 -0400 Subject: [PATCH] Bugfix for when portrait field is blank --- Assets/Fungus/Narrative/Scripts/Character.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/Narrative/Scripts/Character.cs b/Assets/Fungus/Narrative/Scripts/Character.cs index 798dab7d..be44d9bc 100644 --- a/Assets/Fungus/Narrative/Scripts/Character.cs +++ b/Assets/Fungus/Narrative/Scripts/Character.cs @@ -80,7 +80,7 @@ namespace Fungus for (int i = 0; i < portraits.Count; i++) { - if ( String.Compare(portraits[i].name, portrait_string, true) == 0) + if (portraits[i] != null && String.Compare(portraits[i].name, portrait_string, true) == 0) { return portraits[i]; } @@ -100,4 +100,4 @@ namespace Fungus } } -} \ No newline at end of file +}