Browse Source

Fixes #7739: Fix exception when tracing cable across circuit with no far end termination

jeremystretch 4 years ago
parent
commit
f32e694499
2 changed files with 12 additions and 10 deletions
  1. 2 1
      docs/release-notes/version-3.0.md
  2. 10 9
      netbox/dcim/svg.py

+ 2 - 1
docs/release-notes/version-3.0.md

@@ -12,7 +12,8 @@
 
 ### Bug Fixes
 
-* [#7729](https://github.com/netbox-community/netbox/issues/7229) - Fix permissions evaluation when displaying VLAN group VLANs table
+* [#7729](https://github.com/netbox-community/netbox/issues/7729) - Fix permissions evaluation when displaying VLAN group VLANs table
+* [#7739](https://github.com/netbox-community/netbox/issues/7739) - Fix exception when tracing cable across circuit with no far end termination
 * [#7813](https://github.com/netbox-community/netbox/issues/7813) - Fix handling of errors during export template rendering
 
 ---

+ 10 - 9
netbox/dcim/svg.py

@@ -442,15 +442,16 @@ class CableTraceSVG:
                 parent_objects.append(parent_object)
 
             # Near end termination
-            termination = self._draw_box(
-                width=self.width * .8,
-                color=self._get_color(near_end),
-                url=near_end.get_absolute_url(),
-                labels=self._get_labels(near_end),
-                y_indent=PADDING,
-                radius=5
-            )
-            terminations.append(termination)
+            if near_end is not None:
+                termination = self._draw_box(
+                    width=self.width * .8,
+                    color=self._get_color(near_end),
+                    url=near_end.get_absolute_url(),
+                    labels=self._get_labels(near_end),
+                    y_indent=PADDING,
+                    radius=5
+                )
+                terminations.append(termination)
 
             # Connector (either a Cable or attachment to a ProviderNetwork)
             if connector is not None: