Fix crash if auto detect language on checkout page, and the language couldn't be detected (Fix #4881) (#4888)

This commit is contained in:
Nicolas Dorier
2023-04-17 10:53:45 +09:00
committed by GitHub
parent 8e60932f81
commit b0c1b0895d
2 changed files with 2 additions and 2 deletions

View File

@@ -754,7 +754,7 @@ namespace BTCPayServer.Controllers
{
case "auto":
case null when storeBlob.AutoDetectLanguage:
lang = _languageService.AutoDetectLanguageUsingHeader(HttpContext.Request.Headers, null).Code;
lang = _languageService.AutoDetectLanguageUsingHeader(HttpContext.Request.Headers, null)?.Code;
break;
case { } langs when !string.IsNullOrEmpty(langs):
{