From e96e63f7ef78c3e0a804fb4362e4259d00efc508 Mon Sep 17 00:00:00 2001 From: Carael Date: Wed, 28 Aug 2024 12:44:41 +0200 Subject: [PATCH] fix --- src/Core/ContainerResourceOptions.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Core/ContainerResourceOptions.cs b/src/Core/ContainerResourceOptions.cs index f8ca344..afefb0c 100644 --- a/src/Core/ContainerResourceOptions.cs +++ b/src/Core/ContainerResourceOptions.cs @@ -46,10 +46,15 @@ private static void AddLocalDockerAuthentication(DockerConfiguration containerCo { foreach (var auth in dockerAuthRootObject.Auths) { - var address = new Uri(auth.Key); + if(!Uri.TryCreate(auth.Key, UriKind.RelativeOrAbsolute, out Uri address)) + { + continue; + } if (containerConfig.Registries.Any(p => - p.Address.Equals(address.ToString(), StringComparison.InvariantCultureIgnoreCase))) + p.Address.Equals(address.ToString(), StringComparison.InvariantCultureIgnoreCase)) || + string.IsNullOrEmpty(auth.Value.Email) || + string.IsNullOrEmpty(auth.Value.Auth)) { continue; }