diff --git a/MvsSln/Core/SlnParser.cs b/MvsSln/Core/SlnParser.cs index 9042a1a..4cb81fc 100644 --- a/MvsSln/Core/SlnParser.cs +++ b/MvsSln/Core/SlnParser.cs @@ -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) diff --git a/MvsSlnTest/SlnTest.cs b/MvsSlnTest/SlnTest.cs index 8527210..c2fcbec 100644 --- a/MvsSlnTest/SlnTest.cs +++ b/MvsSlnTest/SlnTest.cs @@ -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() {