فهرست منبع

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 <jstretch@netboxlabs.com>

* Check far_ends rather than altering draw_far_objects

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
bctiemann 1 سال پیش
والد
کامیت
8d6cec408c
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      netbox/dcim/svg/cables.py

+ 1 - 1
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)