diff --git a/backend/LexBoxApi/Services/HgService.cs b/backend/LexBoxApi/Services/HgService.cs index 688928ab97..c89a32a7df 100644 --- a/backend/LexBoxApi/Services/HgService.cs +++ b/backend/LexBoxApi/Services/HgService.cs @@ -286,11 +286,13 @@ public async Task InvalidateDirCache(string code) return int.TryParse(str, out int result) ? result : null; } - private async Task ExecuteHgCommandServerCommand(string code, string command, CancellationToken token) + private async Task ExecuteHgCommandServerCommand(string code, string command, CancellationToken? token) { var httpClient = _hgClient.Value; var baseUri = _options.Value.HgCommandServer; - var response = await httpClient.GetAsync($"{baseUri}{code}/{command}", HttpCompletionOption.ResponseHeadersRead, token); + var response = token == null + ? await httpClient.GetAsync($"{baseUri}{code}/{command}", HttpCompletionOption.ResponseHeadersRead) + : await httpClient.GetAsync($"{baseUri}{code}/{command}", HttpCompletionOption.ResponseHeadersRead, token.Value); response.EnsureSuccessStatusCode(); return response.Content; }