1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 04:32:11 +08:00

Fix duplicates not being ignored if hash is null

This commit is contained in:
smoogipoo
2018-11-30 18:40:06 +09:00
Unverified
parent 795933d1a1
commit 4144f4bd2f
+1 -1
View File
@@ -508,7 +508,7 @@ namespace osu.Game.Database
/// </summary>
/// <param name="model">The new model proposed for import. Note that <see cref="Populate"/> has not yet been run on this model.</param>
/// <returns>An existing model which matches the criteria to skip importing, else null.</returns>
protected virtual TModel CheckForExisting(TModel model) => ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash);
protected virtual TModel CheckForExisting(TModel model) => model.Hash == null ? null : ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash);
private DbSet<TModel> queryModel() => ContextFactory.Get().Set<TModel>();