From f85d02fbf7bbaa408c1af8642c71122152e3bebd Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Tue, 28 Apr 2020 17:01:27 -0700 Subject: [PATCH] Fix when no CommandInfo comes back --- .../Services/PowerShellContext/Utilities/CommandHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs index 598e44f29..79faecb06 100644 --- a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs +++ b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs @@ -96,7 +96,7 @@ public static async Task GetCommandInfoAsync( .FirstOrDefault(); // Only cache CmdletInfos since they're exposed in binaries they are likely to not change throughout the session. - if (commandInfo.CommandType == CommandTypes.Cmdlet) + if (commandInfo?.CommandType == CommandTypes.Cmdlet) { s_commandInfoCache.TryAdd(commandName, commandInfo); }