From a2e42134f0f301d98440e28fc229480fbefc0c28 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 11 Apr 2017 18:10:20 +0200 Subject: [PATCH] Do not crash if an interface does not have an IP address. --- pandora_agents/win32/bin/util/ifaces.vbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_agents/win32/bin/util/ifaces.vbs b/pandora_agents/win32/bin/util/ifaces.vbs index b9d2e449e4..2e3a14251f 100644 --- a/pandora_agents/win32/bin/util/ifaces.vbs +++ b/pandora_agents/win32/bin/util/ifaces.vbs @@ -40,7 +40,8 @@ If (NOT flag) Then set ifaces_cfg = objWMIService.ExecQuery("Select ipaddress from Win32_NetworkAdapterConfiguration Where Caption='" & iface.caption & "'") Wscript.StdOut.Write " "" ) then + On Error Resume Next + if (iface_cfg.IPAddress(0) <> "" ) then Wscript.StdOut.Write trim(iface_cfg.IPAddress(0)) end if next