Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Fix missing null checks in package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
hach-que committed Mar 19, 2016
1 parent ee83e58 commit 13cf409
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Protobuild.FunctionalTests/QueryFeaturesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void GenerationIsCorrect()
"no-host-generate",
"propagate-features",
"task-parallelisation",
};
};

_assert.Equal(expectedFeatureList, featureList);
}
Expand Down
15 changes: 13 additions & 2 deletions Protobuild.Internal/Packages/PackageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,15 @@ public void ResolveAll(ModuleInfo module, string platform, bool? enableParalleli
else
{
var metadata = Lookup(module, submodule1, platform, null, null, forceUpgrade);
resultList.Add(new Tuple<string, Action>(submodule1.Uri,
() => { this.Resolve(metadata, submodule1, null, null, forceUpgrade); }));;
if (metadata == null)
{
resultList.Add(new Tuple<string, Action>(submodule1.Uri, () => { }));
}
else
{
resultList.Add(new Tuple<string, Action>(submodule1.Uri,
() => { this.Resolve(metadata, submodule1, null, null, forceUpgrade); }));
}
}
}
else
Expand Down Expand Up @@ -173,6 +180,10 @@ public void Resolve(ModuleInfo module, PackageRef reference, string platform, st
bool forceUpgrade = false)
{
var metadata = Lookup(module, reference, platform, templateName, source, forceUpgrade);
if (metadata == null)
{
return;
}
Resolve(metadata, reference, templateName, source, forceUpgrade);
}

Expand Down
Binary file modified Protobuild.exe
Binary file not shown.
Binary file modified Protobuild/Protobuild.Internal.dll.lzma
Binary file not shown.

0 comments on commit 13cf409

Please sign in to comment.