diff --git a/src/Presentation/Nop.Web/Controllers/CommonController.cs b/src/Presentation/Nop.Web/Controllers/CommonController.cs index 2956ea18069..b371131e57f 100644 --- a/src/Presentation/Nop.Web/Controllers/CommonController.cs +++ b/src/Presentation/Nop.Web/Controllers/CommonController.cs @@ -112,7 +112,7 @@ public virtual IActionResult PageNotFound() public virtual async Task SetLanguage(int langid, string returnUrl = "") { var language = await _languageService.GetLanguageByIdAsync(langid); - if (!language?.Published ?? false) + if (language == null || !language.Published) language = await _workContext.GetWorkingLanguageAsync(); //home page