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>
This commit is contained in:
bctiemann 2024-12-17 15:39:29 -05:00 committed by GitHub
parent e7fcbffaf3
commit 8d6cec408c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)