diff --git a/src/BaGet.Core/Entities/PackageDependency.cs b/src/BaGet.Core/Entities/PackageDependency.cs
index cd1edb39..7ae6f61c 100644
--- a/src/BaGet.Core/Entities/PackageDependency.cs
+++ b/src/BaGet.Core/Entities/PackageDependency.cs
@@ -5,8 +5,16 @@ public class PackageDependency
{
public int Key { get; set; }
+ ///
+ /// The dependency's package ID. Null if this is a dependency group without any dependencies.
+ ///
public string Id { get; set; }
+
+ ///
+ /// The dependency's package version. Null if this is a dependency group without any dependencies.
+ ///
public string VersionRange { get; set; }
+
public string TargetFramework { get; set; }
public Package Package { get; set; }
diff --git a/src/BaGet.Web/Pages/Package.cshtml b/src/BaGet.Web/Pages/Package.cshtml
index 42ca11aa..727478f0 100644
--- a/src/BaGet.Web/Pages/Package.cshtml
+++ b/src/BaGet.Web/Pages/Package.cshtml
@@ -139,17 +139,24 @@ else
- @foreach (var dependency in group.Dependencies)
+ @if (!group.Dependencies.Any())
{
- -
-
- @dependency.PackageId
-
-
- @dependency.VersionSpec
-
+ - No dependencies.
+ }
+ else
+ {
+ @foreach (var dependency in group.Dependencies)
+ {
+ -
+
+ @dependency.PackageId
+
+
+ @dependency.VersionSpec
+
+ }
}
}
diff --git a/src/BaGet.Web/Pages/Package.cshtml.cs b/src/BaGet.Web/Pages/Package.cshtml.cs
index ae764565..1da3fa15 100644
--- a/src/BaGet.Web/Pages/Package.cshtml.cs
+++ b/src/BaGet.Web/Pages/Package.cshtml.cs
@@ -121,6 +121,7 @@ private IReadOnlyList ToDependencyGroups(Package package)
{
Name = PrettifyTargetFramework(group.Key),
Dependencies = group
+ .Where(d => d.Id != null)
.Select(d => new DependencyModel
{
PackageId = d.Id,