Update ReplaceTokens on ModuleBase

Check for Contents == null
This commit is contained in:
Leigh Pointer
2025-11-22 13:31:04 +01:00
parent 476cf7c080
commit 1e3c176ddf

View File

@ -460,6 +460,11 @@ namespace Oqtane.Modules
public string ReplaceTokens(string content, object obj)
{
// check for null or empty content
if (string.IsNullOrEmpty(content))
{
return content;
}
// Using StringBuilder avoids the performance penalty of repeated string allocations
// that occur with string.Replace or string concatenation inside loops.
var sb = new StringBuilder();