From c8680347697b4a9961b6e947694a165ca7cb5c5f Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Mon, 12 Oct 2020 11:10:49 -0400 Subject: [PATCH] fix: Handling a Crestron bug where File.Exists throws an exception on 4-Series instead of returning false --- CHANGELOG.md | 1 + ICD.Common.Utils/IO/IcdFile.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c6f25c..452ea45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Repeater changed to use configured callbacks instead of a dumb event - Scheduled action callbacks allow a TimeSpan to be returned to delay actions + - Handling a Crestron bug where File.Exists throws an exception on 4-Series instead of returning false ## [13.0.0] - 2020-09-03 ### Added diff --git a/ICD.Common.Utils/IO/IcdFile.cs b/ICD.Common.Utils/IO/IcdFile.cs index 0f335d8..11d3151 100644 --- a/ICD.Common.Utils/IO/IcdFile.cs +++ b/ICD.Common.Utils/IO/IcdFile.cs @@ -42,7 +42,15 @@ namespace ICD.Common.Utils.IO if (path == null) throw new ArgumentNullException("path"); - return File.Exists(path); + try + { + return File.Exists(path); + } + // Crestron's AdjustPathForMono method throws an exception that is inconsistent with Net Standard... + catch (Exception) + { + return false; + } } [PublicAPI]