diff --git a/Nodejs/Product/Analysis/Analysis/ModuleTreeExtensions.cs b/Nodejs/Product/Analysis/Analysis/ModuleTreeExtensions.cs index d08542c45..5c118ab62 100644 --- a/Nodejs/Product/Analysis/Analysis/ModuleTreeExtensions.cs +++ b/Nodejs/Product/Analysis/Analysis/ModuleTreeExtensions.cs @@ -28,7 +28,7 @@ internal static IEnumerable GetChildrenExcludingNodeModules(this Mod // The process of resolving modules can lead us to add entries into the underlying array // doing so results in exceptions b/c the array has changed under the enumerable // To avoid this, we call .ToArray() to create a copy of the array locally which we then Enumerate - return moduleTree.Children.Values.ToArray().Where(mod => !String.Equals(mod.Name, AnalysisConstants.NodeModulesFolder, StringComparison.OrdinalIgnoreCase)); + return moduleTree.Children.Values.ToArray().Where(mod => mod != null && !String.Equals(mod.Name, AnalysisConstants.NodeModulesFolder, StringComparison.OrdinalIgnoreCase)); } } }