Skip to content

Commit 7a828a0

Browse files
Fix when no CommandInfo comes back (#1276)
1 parent f06b95f commit 7a828a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static async Task<CommandInfo> GetCommandInfoAsync(
9696
.FirstOrDefault();
9797

9898
// Only cache CmdletInfos since they're exposed in binaries they are likely to not change throughout the session.
99-
if (commandInfo.CommandType == CommandTypes.Cmdlet)
99+
if (commandInfo?.CommandType == CommandTypes.Cmdlet)
100100
{
101101
s_commandInfoCache.TryAdd(commandName, commandInfo);
102102
}

0 commit comments

Comments
 (0)