CP-39929: Prevent whitespace strings from being prepended with timestamp

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2022-08-15 13:10:22 +01:00
parent 54a9f22c87
commit 4340892b59
No known key found for this signature in database
GPG Key ID: 0C48542619080FD4

View File

@ -105,6 +105,7 @@ namespace XenAdmin.Core
/// <summary>
/// Add a new line to the input <see cref="StringBuilder"/>, with options to format the input value before it's appended.
/// timestamps and indentation will be ignored if the input value is an null or whitespace
/// </summary>
/// <param name="builder">The <see cref="StringBuilder"/> to which the modified value will be appended.</param>
/// <param name="value">The value to format before appending.</param>
@ -115,7 +116,7 @@ namespace XenAdmin.Core
public static StringBuilder AppendFormattedLine(this StringBuilder builder, string value, bool addTimestamp = false, bool indent = false, bool addExtraLine = false)
{
var formattedValue = value;
if (!string.IsNullOrEmpty(value))
if (!string.IsNullOrWhiteSpace(value))
{
if (indent)
{