Browse Source

Merge pull request #690 from stevehalliwell/NarrativeLogNameNullCheck

NarrativeLog is tolerant of null Name or Story fields
master
Chris Gregan 7 years ago committed by GitHub
parent
commit
ed1ef1090b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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) if (writerState == WriterState.End)
{ {
AddLine(SayDialog.GetSayDialog().NameText.text, var sd = SayDialog.GetSayDialog();
SayDialog.GetSayDialog().StoryText.text); 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