From 1bf0c83154928863310f7792b825d79b703e6204 Mon Sep 17 00:00:00 2001 From: Nikola Metulev Date: Mon, 28 Aug 2017 10:13:22 -0700 Subject: [PATCH] bug fixes for release mode --- .../Models/Sample.cs | 10 ++++++++-- .../SamplePages/samples.json | 2 +- .../TextToolbar/Symbols/Symbol.cs | 18 +++++++++++++++--- .../Extensions/Tree/LogicalTree.cs | 2 +- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs b/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs index 01ac17c0c..fd37110b2 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs +++ b/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs @@ -193,9 +193,15 @@ namespace Microsoft.Toolkit.Uwp.SampleApp } #if !DEBUG // don't cache for debugging perpuses so it always gets the latests - if (string.IsNullOrWhiteSpace(_cachedDocumentation) && StorageFileHelper.IsFileNameValid(filename)) + if (string.IsNullOrWhiteSpace(_cachedDocumentation)) { - _cachedDocumentation = await StorageFileHelper.ReadTextFromLocalCacheFileAsync(filename); + try + { + _cachedDocumentation = await StorageFileHelper.ReadTextFromLocalCacheFileAsync(filename); + } + catch (Exception) + { + } } #endif diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json index 584b0ce04..d5a680d6e 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json @@ -595,7 +595,7 @@ "XamlCodeFile": "SurfaceDialTextboxCode.bind", "Icon": "/SamplePages/SurfaceDialTextbox/SurfaceDialTextbox.png", "BadgeUpdateVersionRequired": "Anniversary Update required", - "DocumentationUrl": "https://raw.githubusercontent.com/Microsoft/UWPCommunityToolkit/dev/docs/extensions/SurfaceDialTextbox.md" + "DocumentationUrl": "https://raw.githubusercontent.com/Microsoft/UWPCommunityToolkit/dev/docs/extensions/SurfaceDialTextboxHelper.md" } ] }, diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/TextToolbar/Symbols/Symbol.cs b/Microsoft.Toolkit.Uwp.UI.Controls/TextToolbar/Symbols/Symbol.cs index 17c817c49..505be75c6 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/TextToolbar/Symbols/Symbol.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/TextToolbar/Symbols/Symbol.cs @@ -53,10 +53,22 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.TextToolbarSymbols ~Symbol() { - Dispatcher?.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => + try { - isEnabledWatcher?.Dispose(); - }); + Dispatcher?.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => + { + try + { + isEnabledWatcher?.Dispose(); + } + catch (System.Exception) + { + } + }); + } + catch (System.Exception) + { + } } } } \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs b/Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs index eaf85827b..89469ae0c 100644 --- a/Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs +++ b/Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs @@ -250,7 +250,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions var contentpropname = ContentPropertySearch(element.GetType()); if (contentpropname != null) { - return element.GetType().GetProperty(contentpropname).GetValue(element) as UIElement; + return element.GetType()?.GetProperty(contentpropname)?.GetValue(element) as UIElement; } return null;