Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Minor changes InstallationLocalizedService.cs

support713837b68084
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs b/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs
index d2b68f90b..ac8acb676 100644
--- a/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs
+++ b/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs
@@ -91,11 +91,11 @@ namespace Grand.Business.System.Services.Installation
var languageNode = xmlDocument.SelectSingleNode(@"//Language");
- if (languageNode == null || languageNode.Attributes == null)
+ if (languageNode?.Attributes == null)
continue;
//get language friendly name
- var languageName = languageNode.Attributes["Name"].InnerText.Trim();
+ var languageName = languageNode.Attributes["Name"]?.InnerText.Trim();
//is default
var isDefaultAttribute = languageNode.Attributes["IsDefault"];
@@ -159,18 +159,18 @@ namespace Grand.Business.System.Services.Installation
_availableCollation = new List<InstallationCollation>();
var filePath = CommonPath.MapPath("App_Data/Resources/supportedcollation.xml");
- var xmlDocument = new XmlDocument();
+ var xmlDocument = new XmlDocument { XmlResolver = null };
xmlDocument.Load(File.OpenRead(filePath));
var collation = xmlDocument.SelectNodes(@"//Collations/Collation");
- foreach (XmlNode resNode in collation)
+ foreach (XmlNode resNode in collation!)
{
- var resNameAttribute = resNode.Attributes["Name"];
+ var resNameAttribute = resNode.Attributes!["Name"];
var resValueNode = resNode.SelectSingleNode("Value");
- var resourceName = resNameAttribute.Value.Trim();
- var resourceValue = resValueNode.InnerText.Trim();
+ var resourceName = resNameAttribute!.Value.Trim();
+ var resourceValue = resValueNode!.InnerText.Trim();
_availableCollation.Add(new InstallationCollation() {
Name = resourceName,