in reply to Need help with small IF statement

Hi

You state you want to
"if (the ipv4 stuff is defined) {do all the fun printing}".
However what you do is
if (the device is existing) { print all the IP4 and IP6-stuff }

However if the ip4-part isn't existing, you'll get the error you describe accessing it.

You might want to

HTH, Rata