More null checks

This commit is contained in:
2025-06-29 17:48:09 +02:00
parent e10eb03b3d
commit a59d2f6a65

View File

@ -31,10 +31,15 @@ def "tailscale peer" [
})
if $hostname == null {
$peers
} else {
$peers | where host == $hostname | first | get $get_field
return $peers
}
let peers = ($peers | where host == $hostname)
if ($peers | is-empty) {
return null
}
$peers | first | get $get_field
}
# SSH to a tailscale peer