fix gacha fetch

This commit is contained in:
Lightczx
2023-05-01 10:29:11 +08:00
parent 20f353d9eb
commit ba2f2d5708

View File

@@ -145,8 +145,13 @@ internal struct GachaLogFetchContext
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
GachaItemSaveContext saveContext = new(ItemsToAdd, isLazy, QueryOptions.EndId, appDbContext.GachaItems);
TargetArchive!.SaveItems(saveContext);
// While no item is fetched, archive can be null.
if (TargetArchive != null)
{
GachaItemSaveContext saveContext = new(ItemsToAdd, isLazy, QueryOptions.EndId, appDbContext.GachaItems);
TargetArchive.SaveItems(saveContext);
}
}
}