From bbf21a409a7f6e44facb00ad638c289eebd0c7b9 Mon Sep 17 00:00:00 2001 From: KatterMaw Date: Thu, 9 Nov 2023 22:47:15 +0500 Subject: [PATCH] Fix System.InvalidOperationException when unmarking screenshot as asset --- SightKeeper.Domain.Model/Common/Asset.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SightKeeper.Domain.Model/Common/Asset.cs b/SightKeeper.Domain.Model/Common/Asset.cs index cf8ea70b..d4408914 100644 --- a/SightKeeper.Domain.Model/Common/Asset.cs +++ b/SightKeeper.Domain.Model/Common/Asset.cs @@ -60,7 +60,8 @@ public void ClearItems() { foreach (var item in _items) item.ItemClass.RemoveItem(item); - _items.Clear(); + for (var i = _items.Count - 1; i >= 0; i--) + _items.RemoveAt(i); } private readonly ObservableCollection _items;