From d8539c90efbfed96f9eb9a63266412fe74cb8f00 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Mon, 5 Oct 2015 17:02:56 +0100 Subject: [PATCH] Fixed: Null variable reference when substituting variables #278 --- Assets/Fungus/Flowchart/Scripts/Flowchart.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index c0c8fe49..15a0d68d 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -878,6 +878,9 @@ namespace Fungus // Look for any matching variables in this Flowchart first (public or private) foreach (Variable variable in variables) { + if (variable == null) + continue; + if (variable.key == key) { string value = variable.ToString(); @@ -896,6 +899,9 @@ namespace Fungus foreach (Variable variable in flowchart.variables) { + if (variable == null) + continue; + if (variable.scope == VariableScope.Public && variable.key == key) {