From c2fe21e95ba0b339a0b4a14b482d28f554416d15 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Fri, 14 Nov 2014 17:01:27 +0000 Subject: [PATCH] Fixed Command summary to tolerate null strings. --- .../Fungus/FungusScript/Editor/CommandListAdaptor.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/FungusScript/Editor/CommandListAdaptor.cs b/Assets/Fungus/FungusScript/Editor/CommandListAdaptor.cs index 6a3e4f17..e6a98f22 100644 --- a/Assets/Fungus/FungusScript/Editor/CommandListAdaptor.cs +++ b/Assets/Fungus/FungusScript/Editor/CommandListAdaptor.cs @@ -164,7 +164,16 @@ namespace Fungus bool isComment = command.GetType() == typeof(Comment); bool error = false; - string summary = command.GetSummary().Replace("\n", "").Replace("\r", ""); + string summary = command.GetSummary(); + if (summary == null) + { + summary = ""; + } + else + { + summary = summary.Replace("\n", "").Replace("\r", ""); + } + if (summary.Length > 80) { summary = summary.Substring(0, 80) + "...";