From ee42211bc609df1bbdc9ae7e93bf190c52aace78 Mon Sep 17 00:00:00 2001 From: Tiago de Paula Date: Mon, 19 May 2025 22:14:38 -0300 Subject: [PATCH] fix: nil value in haveAvailableRoutes Cause from partially renamed variables in af3c520d. Closes #797 --- src/scripts/lib/linking-utils.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/lib/linking-utils.lua b/src/scripts/lib/linking-utils.lua index 594fe478..b379a1eb 100644 --- a/src/scripts/lib/linking-utils.lua +++ b/src/scripts/lib/linking-utils.lua @@ -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