Fix null ref exception when referencing csproj
This commit is contained in:
parent
9f6a691655
commit
c769d8dee9
|
|
@ -48,7 +48,10 @@ namespace Microsoft.DotNet.Watcher.Core.Internal
|
|||
if (File.Exists(projectLockJsonPath))
|
||||
{
|
||||
var lockFile = LockFileReader.Read(projectLockJsonPath, designTime: false);
|
||||
ProjectDependencies = lockFile.ProjectLibraries.Select(dep => GetProjectRelativeFullPath(dep.Path)).ToList();
|
||||
ProjectDependencies = lockFile.ProjectLibraries
|
||||
.Where(dep => !string.IsNullOrEmpty(dep.Path)) // The dependency path is null for xproj -> csproj reference
|
||||
.Select(dep => GetProjectRelativeFullPath(dep.Path))
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue