From 6b2031de9942fcfc9da02b69be1bd07c21e19cdf Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Tue, 3 Mar 2026 19:54:39 -0500 Subject: [PATCH] clean up IODevice.driver 'none' -> '' early return if name is empty --- lib/io.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/io.ps1 b/lib/io.ps1 index 52c261c..3f75ab8 100644 --- a/lib/io.ps1 +++ b/lib/io.ps1 @@ -120,6 +120,8 @@ class IODevice : IRemote { hidden $_driver = $($this | Add-Member ScriptProperty 'driver' ` { + if ([string]::IsNullOrEmpty($this.name)) { return '' } + $path = $this.remote.workingconfig $oldTime = if (Test-Path $path) { (Get-Item $path).LastWriteTime } else { [DateTime]::MinValue } @@ -141,15 +143,12 @@ class IODevice : IRemote { } Start-Sleep -Milliseconds 20 } while ($sw.elapsed -lt $timeout) - - if (-not $line) { return 'unknown' } $type = $null - if ($line.ToString() -match "type='(?\d+)'") { + if ($line -and $line.ToString() -match "type='(?\d+)'") { $type = $matches['type'] } - if ($null -eq $type) { return 'none' } if ($type -notin $this.drivers.Keys) { return 'unknown' } return $this.drivers[$type] } `