Commit c1f72392 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Included null check (coscine/issues#1279)

parent deb7ffc8
......@@ -198,16 +198,16 @@ namespace Coscine.Api.Project.Controllers
var resourceTypes = _resourceTypeModel.GetAllWhere(x => x.Enabled);
return Json(resourceTypes.Select(x =>
{
{
var projectQuota = _projectQuotaModel.GetWhere((y) =>
y.ProjectId == projectGuid &&
y.ResourceTypeId == x.Id);
return new ProjectQuotaReturnObject
{
Id = x.Id,
Name = x.DisplayName,
Used = CalculateUsed(x, projectGuid),
Allocated = _projectQuotaModel.GetWhere((y) =>
y.ProjectId == projectGuid &&
y.ResourceTypeId == x.Id)
.Quota
Allocated = projectQuota == null ? 0 : projectQuota.Quota
};
}));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment