From 38f591068d8d00a33c5262c51c493b6611c80e1e Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 23 Mar 2016 13:03:30 +0000 Subject: [PATCH] Fixed faulty indent levels when inspector is not displayed #380 --- Assets/Fungus/Flowchart/Editor/BlockEditor.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs index 4512a079..e6a060e4 100644 --- a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs @@ -335,8 +335,9 @@ namespace Fungus // Add event handlers with no category first foreach (System.Type type in eventHandlerTypes) { - EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type); - if (info.Category.Length == 0) + EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type); + if (info != null && + info.Category.Length == 0) { SetEventHandlerOperation operation = new SetEventHandlerOperation(); operation.block = block; @@ -350,7 +351,8 @@ namespace Fungus foreach (System.Type type in eventHandlerTypes) { EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type); - if (info.Category.Length > 0) + if (info != null && + info.Category.Length > 0) { SetEventHandlerOperation operation = new SetEventHandlerOperation(); operation.block = block; @@ -558,7 +560,8 @@ namespace Fungus foreach (System.Type type in eventHandlerTypes) { EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type); - if (info.Category != "" && + if (info != null && + info.Category != "" && !eventHandlerCategories.Contains(info.Category)) { eventHandlerCategories.Add(info.Category); @@ -575,7 +578,8 @@ namespace Fungus { EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type); - if (info.Category == category || + if (info != null && + info.Category == category || info.Category == "" && category == "Core") { markdown += "## " + info.EventHandlerName + "\n";