Fixes possible crash on custom application editing

This commit is contained in:
Matteo Biscosi 2024-01-30 15:08:26 +00:00
parent de544cb1f9
commit 3f703ca062
3 changed files with 14 additions and 21 deletions

View file

@ -640,23 +640,6 @@ end
-- ##############################################
function getCustomnDPIProtoCategories()
local ndpi_protos = interface.getnDPIProtocols()
local key = getCustomnDPIProtoCategoriesKey()
local res = {}
for _, app_id in pairs(ndpi_protos) do
local custom_category = ntop.getHashCache(key, tostring(app_id))
if not isEmptyString(custom_category) then
res[tonumber(app_id)] = tonumber(custom_category)
end
end
return res
end
-- ##############################################
function setCustomnDPIProtoCategory(app_id, new_cat_id)
ntop.setnDPIProtoCategory(app_id, new_cat_id)