Skip to content

Commit

Permalink
Fixed: (Cardigann) Fallback variables to empty string to prevent NullRef
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisbogdan committed Sep 19, 2023
1 parent 9869c22 commit add2988
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public string ApplyGoTemplateText(string template, Dictionary<string, object> va
var newvalue = reReplaceRegexMatches.Groups[3].Value;

var replaceRegex = new Regex(regexp);
var input = (string)variables[variable];
var input = (string)variables[variable] ?? string.Empty;
var expanded = replaceRegex.Replace(input, newvalue);

if (modifier != null)
Expand Down

0 comments on commit add2988

Please sign in to comment.