diff --git a/netbox/ipam/forms.py b/netbox/ipam/forms.py index b4db64d813a..e3fe96c4c63 100644 --- a/netbox/ipam/forms.py +++ b/netbox/ipam/forms.py @@ -490,7 +490,7 @@ def __init__(self, *args, **kwargs): initial['interface_site'] = instance.interface.device.site initial['interface_rack'] = instance.interface.device.rack initial['interface_device'] = instance.interface.device - if instance and instance.nat_inside is not None: + if instance and instance.nat_inside and instance.nat_inside.device is not None: initial['nat_site'] = instance.nat_inside.device.site initial['nat_rack'] = instance.nat_inside.device.rack initial['nat_device'] = instance.nat_inside.device