diff --git a/src/Core/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs b/src/Core/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs index 38c7d5d38..34c24a937 100644 --- a/src/Core/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs +++ b/src/Core/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs @@ -1,4 +1,6 @@ -namespace Bit.App.Controls +using Bit.Core.Services; + +namespace Bit.App.Controls { public partial class AuthenticatorViewCell : BaseCipherViewCell { @@ -16,14 +18,26 @@ if (Handler?.MauiContext == null) { return; } if (_iconImage?.Source == null) { return; } - var result = await _iconImage.Source.GetPlatformImageAsync(Handler.MauiContext); - if (result == null) + try + { + var result = await _iconImage.Source.GetPlatformImageAsync(Handler.MauiContext); + if (result == null) + { + Icon_Error(sender, e); + } + else + { + Icon_Success(sender, e); + } + } + catch (InvalidOperationException) //Can occur with incorrect/malformed uris { Icon_Error(sender, e); } - else + catch(Exception ex) { - Icon_Success(sender, e); + LoggerHelper.LogEvenIfCantBeResolved(ex); + Icon_Error(sender, e); } } } diff --git a/src/Core/Controls/CipherViewCell/CipherViewCell.xaml.cs b/src/Core/Controls/CipherViewCell/CipherViewCell.xaml.cs index 404e475a6..52adb36a6 100644 --- a/src/Core/Controls/CipherViewCell/CipherViewCell.xaml.cs +++ b/src/Core/Controls/CipherViewCell/CipherViewCell.xaml.cs @@ -1,6 +1,7 @@ using System.Windows.Input; using Bit.App.Abstractions; using Bit.App.Pages; +using Bit.Core.Services; using Bit.Core.Utilities; namespace Bit.App.Controls @@ -46,14 +47,26 @@ namespace Bit.App.Controls if (Handler?.MauiContext == null) { return; } if (_iconImage?.Source == null) { return; } - var result = await _iconImage.Source.GetPlatformImageAsync(Handler.MauiContext); - if (result == null) + try + { + var result = await _iconImage.Source.GetPlatformImageAsync(Handler.MauiContext); + if (result == null) + { + Icon_Error(sender, e); + } + else + { + Icon_Success(sender, e); + } + } + catch (InvalidOperationException) //Can occur with incorrect/malformed uris { Icon_Error(sender, e); } - else + catch(Exception ex) { - Icon_Success(sender, e); + LoggerHelper.LogEvenIfCantBeResolved(ex); + Icon_Error(sender, e); } } }