How properly ignore value from dhcp get "array, no such item"

Hi

My script stops on entry in dhcp who are not exist.
I try check if in dhcp leases exist IP address and have a host-name and get it if possible.

ip dhcp-server lease get [find address=10.5.10.51] host-name
no such item
put [ip dhcp-server lease find address=10.5.10.51 ]

put [:typeof [ip dhcp-server lease find address=10.5.10.51 ]]
array

entry who not exist in dhcp leases

put [typeof [ip dhcp-server lease get [find address=10.5.20.1] host-name ]]
no such item

entry who exist but not have hostname

put [typeof [ip dhcp-server lease get [find address=10.5.20.2] host-name ]]
nil

proper entry
put [typeof [ip dhcp-server lease get [find address=10.5.20.3] host-name ]]
str


len – return number of elements in value

When element not exist then len=0, when exist len=1
put [len [ip dhcp-server lease find address=10.5.20.1 ]]
0
put [len [ip dhcp-server lease find address=10.5.20.2 ]]
1
put [len [ip dhcp-server lease find address=10.5.20.3 ]]
1

This means final SOLUTION is:

/ip dhcp-server lease ; :if ([:len [find address=10.5.20.3]] =1 and [:typeof [get [find address=10.5.20.3] host-name ]] = "str" ) do={:put [get [find address=10.5.20.3] host-name ] }
swR1core2

For title and OP question:

:put ([print as-value where address=10.5.20.3]->0->"host-name")

For the other:

:put ([print as-value where address=10.5.20.3 and [:typeof $"host-name"]="str"]->0->"host-name")