🐛 Fix migrate has no value
This commit is contained in:
parent
2691c5d9ac
commit
5487b4e607
@ -43,7 +43,8 @@ public class FileReferenceMigrationService(AppDatabase db)
|
||||
.ToDictionary(g => g.Key, g => g.ToList());
|
||||
|
||||
var fileReferences = posts.SelectMany(post =>
|
||||
attachmentsDict[post.Id].Select(attachment =>
|
||||
attachmentsDict.TryGetValue(post.Id, out var value)
|
||||
? value.Select(attachment =>
|
||||
new CloudFileReference
|
||||
{
|
||||
FileId = attachment.Id,
|
||||
@ -53,6 +54,7 @@ public class FileReferenceMigrationService(AppDatabase db)
|
||||
CreatedAt = SystemClock.Instance.GetCurrentInstant(),
|
||||
UpdatedAt = SystemClock.Instance.GetCurrentInstant()
|
||||
})
|
||||
: []
|
||||
)
|
||||
.ToList();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user