From 98621341a2c86b1c2b1113784a6772fe7ca6af76 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Wed, 1 May 2024 10:52:52 -0300 Subject: [PATCH] PM-7698 Fix crash because the catch logic was wrong and it was allowing certain exception to bubble up and explode, so move the if internally. (#3208) --- src/Core/Utilities/TaskExtensions.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Core/Utilities/TaskExtensions.cs b/src/Core/Utilities/TaskExtensions.cs index 3627a2ae4..93f1fe0f3 100644 --- a/src/Core/Utilities/TaskExtensions.cs +++ b/src/Core/Utilities/TaskExtensions.cs @@ -37,9 +37,12 @@ namespace Bit.Core.Utilities { await task.ConfigureAwait(false); } - catch (Exception ex) when (shouldLogException(ex)) + catch (Exception ex) { - LoggerHelper.LogEvenIfCantBeResolved(ex); + if (shouldLogException(ex)) + { + LoggerHelper.LogEvenIfCantBeResolved(ex); + } } } }