Skip to content

Commit a7a9c26

Browse files
committed
Fix for auto-generated Mod Identity files
For values that are auto-generated, these are invalid in the file, an exception case was added to detect and skip these
1 parent ec420cb commit a7a9c26

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

ModBrowser/ModIdentity/XmlModIdentity.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,15 @@ string ParseString(string attributeName)
7878
// Parse an optional string from XML doc
7979
string? ParseOptionalString(string attributeName)
8080
{
81-
return xmlDocument.Attribute(attributeName)?.Value;
81+
var value = xmlDocument.Attribute(attributeName)?.Value;
82+
83+
// If the value starts with $SPOREMOD, it is a placeholder and should be treated as not present
84+
if (value is not null && value.StartsWith("$SPOREMOD"))
85+
{
86+
return null;
87+
}
88+
89+
return value;
8290
}
8391

8492
// Parse a required version from XML doc

0 commit comments

Comments
 (0)