From d74511b3344b630aabcdf504fab8ade669f50101 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:44:41 +0100 Subject: [PATCH] fix connectivity check cancellation --- Bloxstrap/RobloxInterfaces/Deployment.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/RobloxInterfaces/Deployment.cs b/Bloxstrap/RobloxInterfaces/Deployment.cs index 383cab4..698be79 100644 --- a/Bloxstrap/RobloxInterfaces/Deployment.cs +++ b/Bloxstrap/RobloxInterfaces/Deployment.cs @@ -86,7 +86,7 @@ if (finishedTask.IsFaulted) exceptions.Add(finishedTask.Exception!.InnerException!); - else + else if (!finishedTask.IsCanceled) BaseUrl = finishedTask.Result; } @@ -94,7 +94,11 @@ tokenSource.Cancel(); if (string.IsNullOrEmpty(BaseUrl)) - return exceptions[0]; + { + if (exceptions.Any()) + return exceptions[0]; + return new TaskCanceledException("All tasks have been cancelled"); // we can't add TaskCanceledExceptions to the list + } App.Logger.WriteLine(LOG_IDENT, $"Got {BaseUrl} as the optimal base URL");