mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 14:22:55 +08:00
Update ArchiveModelManager.cs
This commit is contained in:
parent
7efaaceba5
commit
52877eca83
@ -286,9 +286,10 @@ namespace osu.Game.Database
|
|||||||
using (ContextFactory.GetForWrite())
|
using (ContextFactory.GetForWrite())
|
||||||
{
|
{
|
||||||
// re-fetch the model on the import context.
|
// re-fetch the model on the import context.
|
||||||
var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == item.ID);
|
var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).FirstOrDefault(s => s.ID == item.ID);
|
||||||
|
|
||||||
if (foundModel.DeletePending) return;
|
// Test for null since FirstOrDefault will return null if nothing is found
|
||||||
|
if (foundModel == null || foundModel.DeletePending) return;
|
||||||
|
|
||||||
if (ModelStore.Delete(foundModel))
|
if (ModelStore.Delete(foundModel))
|
||||||
Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray());
|
Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray());
|
||||||
|
Loading…
Reference in New Issue
Block a user