Skip to content

Commit ee35ad8

Browse files
author
James Brundage
committed
feat: Get-Turtle inline set fix ( Fixes #108, Fixes #107 )
1 parent ec789b6 commit ee35ad8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Commands/Get-Turtle.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,19 @@ function Get-Turtle {
165165
}
166166

167167
# If the output is not a turtle object, we can output it.
168-
# NOTE: This will lead to multiple types of output in the pipeline.
168+
# NOTE: This may lead to multiple types of output in the pipeline.
169169
# Luckily, this should be one of the few cases where this does not annoy too much.
170-
# Properties being returned will largely be strings or numbers.
171-
if (-not ($stepOutput.pstypenames -eq 'Turtle')) {
170+
# Properties being returned will largely be strings or numbers, and these will always output directly.
171+
if ($null -ne $stepOutput -and -not ($stepOutput.pstypenames -eq 'Turtle')) {
172172
# Output the step
173173
$stepOutput
174174
# and set the output turtle to false.
175175
$outputTurtle = $false
176-
} else {
176+
} elseif ($null -ne $stepOutput) {
177177
# Set the current turtle to the step output.
178178
$currentTurtle = $stepOutput
179179
# and output it later (presumably).
180-
$outputTurtle = $true
180+
$outputTurtle = $true
181181
}
182182
}
183183

0 commit comments

Comments
 (0)