fix: handle nil site in list_neighbors_with_equipment
Fixes BadMapError when loading device show page for devices without an assigned site. Changed to use device.organization_id directly instead of device.site.organization_id since site can be nil but organization is always present.
This commit is contained in:
parent
c70b385db1
commit
8e0fad599e
1 changed files with 1 additions and 1 deletions
|
|
@ -399,7 +399,7 @@ defmodule Towerops.Snmp do
|
|||
device = Towerops.Devices.get_device!(device_id)
|
||||
|
||||
Enum.map(neighbors, fn neighbor ->
|
||||
matched_device = find_matching_equipment(neighbor, device.site.organization_id)
|
||||
matched_device = find_matching_equipment(neighbor, device.organization_id)
|
||||
Map.put(neighbor, :matched_device, matched_device)
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue