Browse Source

NarrativeLog is tolerant of null Name or Story fields

-previously caused nullref in TheFacility Demo Scene
master
desktop-maesty/steve 7 years ago
parent
commit
bcadf28bef
  1. 7
      Assets/Fungus/Scripts/Components/NarrativeLog.cs

7
Assets/Fungus/Scripts/Components/NarrativeLog.cs

@ -66,8 +66,11 @@ namespace Fungus
{
if (writerState == WriterState.End)
{
AddLine(SayDialog.GetSayDialog().NameText.text,
SayDialog.GetSayDialog().StoryText.text);
var sd = SayDialog.GetSayDialog();
var from = sd.NameText != null ? sd.NameText.text : string.Empty;
var line = sd.StoryText != null ? sd.StoryText.text : string.Empty;
AddLine(from, line);
}
}

Loading…
Cancel
Save