We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5f7c87 commit f9f70daCopy full SHA for f9f70da
1 file changed
src/functions/TestResults.NUnit3.ps1
@@ -554,7 +554,12 @@ function Format-CDataString ($Output) {
554
$linesCount = $out.Length
555
$o = for ($i = 0; $i -lt $linesCount; $i++) {
556
# The input is array of objects, convert them to strings.
557
- $line = if ($null -eq $out[$i]) { [String]::Empty } else { $out[$i].ToString() }
+ $line = if ($null -eq $out[$i]) {
558
+ [String]::Empty
559
+ }
560
+ else {
561
+ try { $out[$i].ToString() } catch { "<Output object ToString() failed: $($_.Exception.Message)>" }
562
563
564
if (0 -gt $line.IndexOfAny($script:invalidCDataChars)) {
565
# No special chars that need replacing.
0 commit comments