Skip to content

Commit befa355

Browse files
committed
Remove redundant ObjectDisposedException catches
1 parent 467b216 commit befa355

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Files/ViewModels/ItemViewModel.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ await Task.Run(async () =>
752752
{
753753
await loadExtendedPropsSemaphore.WaitAsync(loadPropsCTS.Token);
754754
}
755-
catch (Exception ex) when (ex is OperationCanceledException || ex is ObjectDisposedException)
755+
catch (OperationCanceledException)
756756
{
757757
return;
758758
}
@@ -911,7 +911,7 @@ public async void RapidAddItemsToCollectionAsync(string path, string previousDir
911911
// simply drop this instance
912912
await enumFolderSemaphore.WaitAsync(semaphoreCTS.Token);
913913
}
914-
catch (Exception ex) when (ex is OperationCanceledException || ex is ObjectDisposedException)
914+
catch (OperationCanceledException)
915915
{
916916
return;
917917
}
@@ -1077,10 +1077,6 @@ await folders.AsyncParallelForEach(async (folder) =>
10771077
}
10781078
}
10791079
}
1080-
catch (ObjectDisposedException ex)
1081-
{
1082-
NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message);
1083-
}
10841080
finally
10851081
{
10861082
enumFolderSemaphore.Release();
@@ -1831,7 +1827,7 @@ private async Task UpdateFileOrFolderAsync(string path)
18311827
{
18321828
await enumFolderSemaphore.WaitAsync(semaphoreCTS.Token);
18331829
}
1834-
catch (Exception ex) when (ex is OperationCanceledException || ex is ObjectDisposedException)
1830+
catch (OperationCanceledException)
18351831
{
18361832
return;
18371833
}
@@ -1876,7 +1872,7 @@ public async Task RemoveFileOrFolderAsync(string path)
18761872
{
18771873
await enumFolderSemaphore.WaitAsync(semaphoreCTS.Token);
18781874
}
1879-
catch (Exception ex) when (ex is OperationCanceledException || ex is ObjectDisposedException)
1875+
catch (OperationCanceledException)
18801876
{
18811877
return;
18821878
}

0 commit comments

Comments
 (0)