Skip to content

Commit

Permalink
Fixes: #17868 - Handle orphaned cable condition gracefully in SVG ren…
Browse files Browse the repository at this point in the history
…dering (#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 <[email protected]>

* Check far_ends rather than altering draw_far_objects

---------

Co-authored-by: Jeremy Stretch <[email protected]>
  • Loading branch information
bctiemann and jeremystretch authored Dec 17, 2024
1 parent e7fcbff commit 8d6cec4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/dcim/svg/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def render(self):
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)
Expand Down

0 comments on commit 8d6cec4

Please sign in to comment.