Fixes attempt to index nil value

This commit is contained in:
Matteo Biscosi 2025-12-03 16:55:26 +01:00
parent 89d38def6b
commit 2bfa14152d

View file

@ -727,6 +727,9 @@ function lists_utils.reset_blacklist_url(list_name, enabled)
if not isEmptyString(lists_metadata) then
current_lists = json.decode(lists_metadata)
end
if not current_lists[list_name] then
current_lists[list_name] = {}
end
current_lists[list_name].url = default_url
ntop.setPref(METADATA_KEY, json.encode(current_lists))
end