@@ -38,7 +38,7 @@ private static void WritePerson(DataInPersonResponse person, ICollection<Resourc
3838 {
3939 ICollection < TodoItemIdentifierInResponse > assignedTodoItems = person . Relationships . AssignedTodoItems ? . Data ?? [ ] ;
4040
41- builder . AppendLine ( $ " Person { person . Id } : { person . Attributes . DisplayName } with { assignedTodoItems . Count } assigned todo-items:") ;
41+ builder . AppendLine ( $ " Person { person . Id } : { person . Attributes . DisplayName ?? string . Empty } with { assignedTodoItems . Count } assigned todo-items:") ;
4242 WriteRelatedTodoItems ( assignedTodoItems , includes , builder ) ;
4343 }
4444
@@ -48,9 +48,9 @@ private static void WriteRelatedTodoItems(IEnumerable<TodoItemIdentifierInRespon
4848 foreach ( TodoItemIdentifierInResponse todoItemIdentifier in todoItemIdentifiers )
4949 {
5050 DataInTodoItemResponse includedTodoItem = includes . OfType < DataInTodoItemResponse > ( ) . Single ( include => include . Id == todoItemIdentifier . Id ) ;
51- ICollection < TagIdentifierInResponse > tags = includedTodoItem . Relationships . Tags ? . Data ?? [ ] ;
51+ ICollection < TagIdentifierInResponse > tags = includedTodoItem . Relationships ? . Tags ? . Data ?? [ ] ;
5252
53- builder . AppendLine ( $ " TodoItem { includedTodoItem . Id } : { includedTodoItem . Attributes . Description } with { tags . Count } tags:") ;
53+ builder . AppendLine ( $ " TodoItem { includedTodoItem . Id } : { includedTodoItem . Attributes . Description ?? string . Empty } with { tags . Count } tags:") ;
5454 WriteRelatedTags ( tags , includes , builder ) ;
5555 }
5656 }
@@ -60,7 +60,7 @@ private static void WriteRelatedTags(IEnumerable<TagIdentifierInResponse> tagIde
6060 foreach ( TagIdentifierInResponse tagIdentifier in tagIdentifiers )
6161 {
6262 DataInTagResponse includedTag = includes . OfType < DataInTagResponse > ( ) . Single ( include => include . Id == tagIdentifier . Id ) ;
63- builder . AppendLine ( $ " Tag { includedTag . Id } : { includedTag . Attributes . Name } ") ;
63+ builder . AppendLine ( $ " Tag { includedTag . Id } : { includedTag . Attributes ? . Name ?? string . Empty } ") ;
6464 }
6565 }
6666}
0 commit comments