Skip to content

Commit 321b726

Browse files
authored
Format-Wide: Fix NullReferenceException (PowerShell#15990)
1 parent a4d1457 commit 321b726

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ private string GenerateRow(string[] values, ReadOnlySpan<int> alignment, Display
458458
}
459459

460460
sb.Append(GenerateRowField(values[k], _si.columnInfo[k].width, alignment[k], dc, addPadding));
461-
if (values[k].Contains(ESC))
461+
if (values[k] is not null && values[k].Contains(ESC))
462462
{
463463
// Reset the console output if the content of this column contains ESC
464464
sb.Append(PSStyle.Instance.Reset);

0 commit comments

Comments
 (0)