From 206f5db89264823808a010d117c7cb6b89ac34c3 Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Mon, 15 Apr 2019 20:26:46 +1000 Subject: [PATCH] Enforce Flowchart selectedBlocks and selectedCommands collections are not null --- Assets/Fungus/Scripts/Components/Flowchart.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Fungus/Scripts/Components/Flowchart.cs b/Assets/Fungus/Scripts/Components/Flowchart.cs index 5fd99a6f..9dcb3b82 100644 --- a/Assets/Fungus/Scripts/Components/Flowchart.cs +++ b/Assets/Fungus/Scripts/Components/Flowchart.cs @@ -230,6 +230,9 @@ namespace Fungus // It shouldn't happen but it seemed to occur for a user on the forum variables.RemoveAll(item => item == null); + if (selectedBlocks == null) selectedBlocks = new List(); + if (selectedCommands == null) selectedCommands = new List(); + selectedBlocks.RemoveAll(item => item == null); selectedCommands.RemoveAll(item => item == null);