From d31cc920403b1e1f90a48d2569084c2f6a4d7dbe Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 11 Aug 2020 01:16:56 +0800 Subject: Make author column of post nullable. --- Timeline/Services/TimelineService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Timeline/Services/TimelineService.cs') diff --git a/Timeline/Services/TimelineService.cs b/Timeline/Services/TimelineService.cs index eafb0088..ad410d15 100644 --- a/Timeline/Services/TimelineService.cs +++ b/Timeline/Services/TimelineService.cs @@ -413,9 +413,7 @@ namespace Timeline.Services private async Task MapTimelinePostFromEntity(TimelinePostEntity entity, string timelineName) { - - - var author = await _userService.GetUserById(entity.AuthorId); + User? author = entity.AuthorId.HasValue ? await _userService.GetUserById(entity.AuthorId.Value) : null; ITimelinePostContent? content = null; -- cgit v1.2.3