Skip to content

Commit

Permalink
a single null parameter makes the whole format expression null (propa…
Browse files Browse the repository at this point in the history
…gating error state)
  • Loading branch information
SWeini committed Jan 26, 2025
1 parent a49113c commit fc0ef22
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Yafc.Parser/Data/LocalisedStringParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ internal static class LocalisedStringParser {
break;
default:
if (int.TryParse(type, out int idx) && idx >= 1 && idx <= parameters.Length) {
result.Append(parameters[idx - 1]);
string? referencedParameter = parameters[idx - 1];
if (referencedParameter == null) {
return null;
}

result.Append(referencedParameter);
}
else {
result.Append(format[start..(end + 2)]);
Expand Down

0 comments on commit fc0ef22

Please sign in to comment.