diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index c223a8f4..d154fc8f 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -623,7 +623,7 @@ namespace Fungus { foreach (Variable v in variables) { - if (v.key == key) + if (v != null && v.key == key) { BooleanVariable variable = v as BooleanVariable; if (variable != null)