From 179ea597630ebdbde64bbaf2ea520849a9785b3c Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Fri, 10 Nov 2023 01:08:20 +0900 Subject: [PATCH] Fix: Fixed possible crash when adding files and folders (#13770) --- .../Utils/Storage/Collection/ConcurrentCollection.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Files.App/Utils/Storage/Collection/ConcurrentCollection.cs b/src/Files.App/Utils/Storage/Collection/ConcurrentCollection.cs index 3a8aa0bccdab..bed6cf67c70a 100644 --- a/src/Files.App/Utils/Storage/Collection/ConcurrentCollection.cs +++ b/src/Files.App/Utils/Storage/Collection/ConcurrentCollection.cs @@ -257,6 +257,14 @@ public void OrderOne(Func, IEnumerable> func, T item) Insert(index, item); } + public List ToList() + { + lock (syncRoot) + { + return Enumerable.ToList(this); + } + } + int IList.Add(object? value) { if (value is null)