Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: #17868 - Handle orphaned cable condition gracefully in SVG rendering #18244

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

bctiemann
Copy link
Contributor

Fixes: #17868

If a device has been deleted, attached cables may be left orphaned, which leads to rendering errors when generating the cable trace SVG. This fix handles the case where the object list passed in to draw_far_objects is empty by returning empty lists of results and then handling those gracefully so that the remaining portion of the SVG can be rendered.

@bctiemann bctiemann self-assigned this Dec 17, 2024
netbox/dcim/svg/cables.py Outdated Show resolved Hide resolved
netbox/dcim/svg/cables.py Outdated Show resolved Hide resolved
bctiemann and others added 2 commits December 17, 2024 14:44
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
@jeremystretch jeremystretch merged commit 8d6cec4 into develop Dec 17, 2024
6 checks passed
@jeremystretch jeremystretch deleted the 17868-fix-divide-by-zero-on-cable-trace branch December 17, 2024 20:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cable Trace leads to "division by zero" if the last cable is not connected
2 participants