diff --git a/Assets/Fungus/Dialog/Commands/Say.cs b/Assets/Fungus/Dialog/Commands/Say.cs index e9e40066..2d801176 100644 --- a/Assets/Fungus/Dialog/Commands/Say.cs +++ b/Assets/Fungus/Dialog/Commands/Say.cs @@ -102,7 +102,10 @@ namespace Fungus.Script { foreach (SayOption option in options) { - connectedSequences.Add(option.targetSequence); + if (option.targetSequence != null) + { + connectedSequences.Add(option.targetSequence); + } } } } diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs index 8922a291..75bf4e45 100755 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs @@ -289,6 +289,11 @@ namespace Fungus.Script void DrawConnections(FungusScript fungusScript, Sequence sequence, bool highlightedOnly) { + if (sequence == null) + { + return; + } + List connectedSequences = new List(); bool sequenceIsSelected = (fungusScript.selectedSequence == sequence); @@ -309,6 +314,11 @@ namespace Fungus.Script foreach (Sequence sequenceB in connectedSequences) { + if (sequenceB == null) + { + continue; + } + DrawRectConnection(sequence.nodeRect, sequenceB.nodeRect, highlight); } } diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index b008c8c2..53da21f3 100644 Binary files a/Assets/Shuttle/ShuttleGame.unity and b/Assets/Shuttle/ShuttleGame.unity differ