From 8d6cec408cb8a50a1c98284185456ff6a96efd47 Mon Sep 17 00:00:00 2001 From: bctiemann Date: Tue, 17 Dec 2024 15:39:29 -0500 Subject: [PATCH] Fixes: #17868 - Handle orphaned cable condition gracefully in SVG rendering (#18244) * Handle condition gracefully where an empty object list is passed in to draw_far_objects (e.g. orphaned cable where attached device has been deleted) * Move continue statement to right after draw_far_objects * Preferable falsy syntax Co-authored-by: Jeremy Stretch * Check far_ends rather than altering draw_far_objects --------- Co-authored-by: Jeremy Stretch --- netbox/dcim/svg/cables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index 4e0f7aea6..58fa27c6b 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -362,7 +362,7 @@ class CableTraceSVG: self.cursor += CABLE_HEIGHT # Connector (a Cable or WirelessLink) - if links: + if links and far_ends: obj_list = {end.parent_object for end in far_ends} parent_object_nodes, far_terminations = self.draw_far_objects(obj_list, far_ends)