Skip to content

Commit

Permalink
Null check
Browse files Browse the repository at this point in the history
  • Loading branch information
simpat-adam committed Jul 17, 2024
1 parent 7d933f9 commit f673452
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/EdFi.DataManagementService.Core/ApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,12 @@ public JsonArray GetDependencies()
foreach (JsonNode projectSchemaNode in projectSchemaNodes)
{

var resourceSchemasObj = projectSchemaNode["resourceSchemas"]!.AsObject().Select(x => new ResourceSchema(x.Value!));
var resourceSchemas = projectSchemaNode["resourceSchemas"]?.AsObject().Select(x => new ResourceSchema(x.Value!)).ToList()!;

Dictionary<string, List<string>> dependencies =
resourceSchemasObj!.ToDictionary(rs => rs.ResourceName.Value, rs => new List<string>());
resourceSchemas.ToDictionary(rs => rs.ResourceName.Value, rs => new List<string>());

foreach (var resourceSchema in resourceSchemasObj)
foreach (var resourceSchema in resourceSchemas)
{
foreach (var documentPath in resourceSchema.DocumentPaths.Where(d => d.IsReference))
{
Expand All @@ -317,7 +317,7 @@ public JsonArray GetDependencies()

int RecursivelyDetermineDependencies(string resourceName, int depth)
{

// Code Smell here:
// These resources are similar to abstract base classes, so they are not represented in the resourceSchemas
// portion of the schema document. This is a rudimentary replacement with the most specific version of the resource
if (resourceName == "EducationOrganization")
Expand Down

0 comments on commit f673452

Please sign in to comment.