diff --git a/ICD.Common.Utils/SafeMutex.cs b/ICD.Common.Utils/SafeMutex.cs index c2d3bb2..66c2798 100644 --- a/ICD.Common.Utils/SafeMutex.cs +++ b/ICD.Common.Utils/SafeMutex.cs @@ -66,6 +66,7 @@ namespace ICD.Common.Utils } catch (ObjectDisposedException) { + // Releasing a disposed mutex in this case is valid behaviour } } diff --git a/ICD.Common.Utils/StringUtils.cs b/ICD.Common.Utils/StringUtils.cs index ce73daa..f08e271 100644 --- a/ICD.Common.Utils/StringUtils.cs +++ b/ICD.Common.Utils/StringUtils.cs @@ -277,21 +277,20 @@ namespace ICD.Common.Utils throw new ArgumentNullException("convertFunc"); result = default(T); - bool retVal = false; - + try { result = convertFunc(value); - retVal = true; + return true; } catch (FormatException) { + return false; } catch (InvalidCastException) { + return false; } - - return retVal; } ///