From cf303f2f97c2b09ccb0df2743260cea531f7c6cc Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 28 Jul 2020 23:22:02 -0400 Subject: [PATCH] catch errors when trying to resolve DNS (#841) --- src/Icons/Services/IconFetchingService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Icons/Services/IconFetchingService.cs b/src/Icons/Services/IconFetchingService.cs index d2acfe1069..9998340e03 100644 --- a/src/Icons/Services/IconFetchingService.cs +++ b/src/Icons/Services/IconFetchingService.cs @@ -292,8 +292,15 @@ namespace Bit.Icons.Services } // Resolve host to make sure it is not an internal/private IP address - var hostEntry = Dns.GetHostEntry(uri.Host); - if (hostEntry?.AddressList.Any(ip => IsInternal(ip)) ?? true) + try + { + var hostEntry = Dns.GetHostEntry(uri.Host); + if (hostEntry?.AddressList.Any(ip => IsInternal(ip)) ?? true) + { + return null; + } + } + catch { return null; }