Skip to content

Commit

Permalink
Fixed SlnItems.ProjectDependenciesXml when empty input:
Browse files Browse the repository at this point in the history
  • Loading branch information
3F committed Aug 3, 2021
1 parent 9b7134d commit f5374f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MvsSln/Core/SlnParser.cs
Expand Up @@ -156,7 +156,7 @@ public ISlnResult Parse(StreamReader reader, SlnItems type)

if((type & SlnItems.ProjectDependenciesXml) == SlnItems.ProjectDependenciesXml)
{
if(data.Env?.Projects != null)
if(data.ProjectDependencies != null && data.Env?.Projects != null)
{
// The following class provides additional features for project references in ISlnPDManager manner,
// But we'll just activate references for existing ProjectDependencies (shallow copy)
Expand Down
10 changes: 10 additions & 0 deletions MvsSlnTest/SlnTest.cs
Expand Up @@ -424,6 +424,16 @@ public void SlnItemsTest2()
}
}

[Fact]
public void SlnItemsTest3()
{
//report https://github.com/3F/MvsSln/issues/25#issuecomment-743840401
using(var sln = new Sln(SlnItems.All, string.Empty))
{
Assert.Null(sln.Result.ProjectDependencies);
}
}

[Fact]
public void MapTest1()
{
Expand Down

0 comments on commit f5374f8

Please sign in to comment.