mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-24 08:46:48 +08:00
Fixes null culture (#8723)
Fixes null culture bug and prevents to query the database if the requested culture is null or empty
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -87,6 +87,9 @@ namespace Orchard.Localization.Services {
|
||||
});
|
||||
}
|
||||
public CultureRecord GetCultureByName(string cultureName) {
|
||||
if (string.IsNullOrWhiteSpace(cultureName)) {
|
||||
return null;
|
||||
}
|
||||
var cultures = GetAllCulturesByName();
|
||||
CultureRecord result;
|
||||
cultures.TryGetValue(cultureName, out result);
|
||||
|
||||
Reference in New Issue
Block a user