Skip to content

Commit b6d0d9f

Browse files
author
Robert Holt
committed
Fix NRE
1 parent 0af120e commit b6d0d9f

File tree

1 file changed

+5
-0
lines changed
  • PSCompatibilityAnalyzer/Microsoft.PowerShell.CrossCompatibility/Query

1 file changed

+5
-0
lines changed

PSCompatibilityAnalyzer/Microsoft.PowerShell.CrossCompatibility/Query/RuntimeData.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ private static IReadOnlyDictionary<string, IReadOnlyList<CommandData>> CreateAli
134134
{
135135
foreach (KeyValuePair<Version, Data.Modules.ModuleData> moduleVersion in module.Value)
136136
{
137+
if (moduleVersion.Value.Aliases == null)
138+
{
139+
continue;
140+
}
141+
137142
foreach (KeyValuePair<string, string> alias in moduleVersion.Value.Aliases)
138143
{
139144
if (commands.TryGetValue(alias.Value, out IReadOnlyList<CommandData> aliasedCommands))

0 commit comments

Comments
 (0)