fix: nil value in haveAvailableRoutes

Cause from partially renamed variables in af3c520d.

Closes #797
This commit is contained in:
Tiago de Paula 2025-05-19 22:14:38 -03:00
parent 76b9e509d1
commit ee42211bc6
No known key found for this signature in database
GPG key ID: 55BD118E42C985CF

View file

@ -387,10 +387,10 @@ function lutils.haveAvailableRoutes (si_props, devices_om)
-- Check if available routes support the node's card.profile.device
local found = 0
for r in device:iterate_params ("EnumRoute") do
local route = cutils.parseParam (p, "EnumRoute")
local route = cutils.parseParam (r, "EnumRoute")
if route and type (route.devices) == "table" then
for _, i in ipairs (route.devices) do
if i == tonumber (cpd) then
if i == tonumber (card_profile_device) then
found = found + 1
if route.available ~= "no" then
return true