mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #7279: Fix exception when tracing cable with no associated path
This commit is contained in:
@ -2411,6 +2411,12 @@ class PathTraceView(generic.ObjectView):
|
||||
else:
|
||||
path = related_paths.first()
|
||||
|
||||
# No paths found
|
||||
if path is None:
|
||||
return {
|
||||
'path': None
|
||||
}
|
||||
|
||||
# Get the total length of the cable and whether the length is definitive (fully defined)
|
||||
total_length, is_definitive = path.get_total_length() if path else (None, False)
|
||||
|
||||
|
Reference in New Issue
Block a user