diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index 0c308c245..4de30f5cb 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -370,6 +370,11 @@ class CableTraceSVG: obj_list = {end.parent_object for end in far_ends} parent_object_nodes, far_terminations = self.draw_far_objects(obj_list, far_ends) + + # If there are no far terminations, this segment can't be rendered, so skip. + if not far_terminations: + continue + for cable in links: # Fill in labels and description with all available data description = [ @@ -409,10 +414,6 @@ class CableTraceSVG: near = [term for term in near_terminations if term.object == cable.interface_b] far = [term for term in far_terminations if term.object == cable.interface_a] - # If at this point we have no near or no far terminations, this cable can't be rendered, so skip. - if not (near and far): - continue - # Select most-probable start and end position start = near[0].bottom_center end = far[0].top_center