Browse Source

Ignore null commands in command list

Commands typically become null in the command list when there’s been a
change to a command script (e.g. upgrading to a new version of Fungus).
It’s better to just ignore this rather than cause a null exception.
master
chrisgregan 9 years ago
parent
commit
3de9f1eeb2
  1. 7
      Assets/Fungus/Flowchart/Scripts/Commands/If.cs

7
Assets/Fungus/Flowchart/Scripts/Commands/If.cs

@ -105,7 +105,12 @@ namespace Fungus
for (int i = commandIndex + 1; i < parentBlock.commandList.Count; ++i) for (int i = commandIndex + 1; i < parentBlock.commandList.Count; ++i)
{ {
Command nextCommand = parentBlock.commandList[i]; Command nextCommand = parentBlock.commandList[i];
if (nextCommand == null)
{
continue;
}
// Find next command at same indent level as this If command // Find next command at same indent level as this If command
// Skip disabled commands, comments & labels // Skip disabled commands, comments & labels
if (!nextCommand.enabled || if (!nextCommand.enabled ||

Loading…
Cancel
Save