Added traceback in case of nil score

This commit is contained in:
MatteoBiscosi 2022-07-20 13:14:49 +02:00
parent 3db8cc6cc8
commit 3f214341ea
18 changed files with 31 additions and 19 deletions

View file

@ -5517,6 +5517,18 @@ function format_name_value(name, value, shorten)
return formatted_name_value
end
-- ##############################################
function map_score_to_severity(score)
if score ~= nil then
return ntop.mapScoreToSeverity(score)
end
traceError(TRACE_ERROR, TRACE_CONSOLE, "Nil score value instead of number")
tprint(debug.traceback())
return ntop.mapScoreToSeverity(0)
end
--
-- IMPORTANT
-- Leave it at the end so it can use the functions