diff --git a/LethalAPI.Terminal/Models/CommandHandler.cs b/LethalAPI.Terminal/Models/CommandHandler.cs index bd0f3f1..7a5d6da 100644 --- a/LethalAPI.Terminal/Models/CommandHandler.cs +++ b/LethalAPI.Terminal/Models/CommandHandler.cs @@ -179,7 +179,7 @@ public static class CommandHandler continue; } - // A pass-though delegate to execute interactions, and return the response `TerminalNode` or null + // A pass-through delegate to execute interactions, and return the response `TerminalNode` or null var passThrough = () => HandleCommandResult(invoker(), terminal); candidateCommands.Add((registeredCommand, passThrough)); @@ -208,6 +208,11 @@ public static class CommandHandler /// command display response private static TerminalNode? HandleCommandResult(object? result, Terminal terminal) { + if (result is null) + { + return null; + } + if (result is TerminalNode node) { return node;