Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion LethalAPI.Terminal/Models/CommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -208,6 +208,11 @@ public static class CommandHandler
/// <returns><seealso cref="TerminalNode"/> command display response</returns>
private static TerminalNode? HandleCommandResult(object? result, Terminal terminal)
{
if (result is null)
{
return null;
}

if (result is TerminalNode node)
{
return node;
Expand Down