From b0c1b0895dc1367e0473ec5e5c7ccc791cbcac04 Mon Sep 17 00:00:00 2001 From: Nicolas Dorier Date: Mon, 17 Apr 2023 10:53:45 +0900 Subject: [PATCH] Fix crash if auto detect language on checkout page, and the language couldn't be detected (Fix #4881) (#4888) --- BTCPayServer/Controllers/UIInvoiceController.UI.cs | 2 +- BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Controllers/UIInvoiceController.UI.cs b/BTCPayServer/Controllers/UIInvoiceController.UI.cs index 367a73309..bb5b7f119 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.UI.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.UI.cs @@ -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): { diff --git a/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml b/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml index ca8316acb..76fa3d32f 100644 --- a/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml +++ b/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml @@ -167,7 +167,7 @@
-
Detects the language of the customer's browser with 99.9% accuracy.
+
Detects the language of the customer's browser.