From bf52317b336d07576d08bbb209c637ab9b60f002 Mon Sep 17 00:00:00 2001 From: PeterO2 Date: Thu, 13 Feb 2020 15:36:41 +0100 Subject: [PATCH] fix: ipam interface should check on virtualmachine nil state --- lib/netbox_client_ruby/api/ipam/ip_address.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netbox_client_ruby/api/ipam/ip_address.rb b/lib/netbox_client_ruby/api/ipam/ip_address.rb index 0d73890..0125adc 100644 --- a/lib/netbox_client_ruby/api/ipam/ip_address.rb +++ b/lib/netbox_client_ruby/api/ipam/ip_address.rb @@ -34,7 +34,7 @@ def interface return nil unless interface_data - if interface_data.key?('virtual_machine') + if interface_data.key? ('virtual_machine') and not interface_data['virtual_machine'].nil? Virtualization::Interface.new interface_data['id'] else DCIM::Interface.new interface_data['id']