Skip to content

Commit

Permalink
Merge pull request #2868 from FirelyTeam/fix/contained-resource-witho…
Browse files Browse the repository at this point in the history
…ut-id-in-cache

contained resource ref cache fix
  • Loading branch information
mmsmits authored Sep 19, 2024
2 parents d7ef0cf + d3b1202 commit d560ccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/ElementModel/ScopedNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private ReferencedResourceCache getOrInitContainedCache()
if (AtResource)
{
var referenceEntryPairs = from contained in this.Children("contained")
let id = $"#{contained.Children("id").FirstOrDefault()?.Value as string}"
let id = contained.Children("id").FirstOrDefault()?.Value is string s ? $"#{s}" : null
let resource = contained as ScopedNode
select new KeyValuePair<string, ScopedNode?>(id, resource);
_cache.ContainedResources = new ReferencedResourceCache(referenceEntryPairs);
Expand Down

0 comments on commit d560ccb

Please sign in to comment.