Skip to content

Commit 1a8531f

Browse files
committed
fix(DocumentBuilder): handle case when hasOne relationship type is unknown
1 parent 34cc271 commit 1a8531f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/JsonApiDotNetCore/Builders/DocumentBuilder.cs

+2
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ private ResourceIdentifierObject GetIndependentRelationshipIdentifier(HasOneAttr
276276
return null;
277277

278278
var relatedContextEntity = _jsonApiContext.ContextGraph.GetContextEntity(hasOne.Type);
279+
if (relatedContextEntity == null) // TODO: this should probably be a debug log at minimum
280+
return null;
279281

280282
return new ResourceIdentifierObject
281283
{

0 commit comments

Comments
 (0)