mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Safety check and tracing in get_alert_triggered_key
This commit is contained in:
parent
5ce70a41e6
commit
6f8809954d
1 changed files with 5 additions and 2 deletions
|
|
@ -89,8 +89,11 @@ end
|
|||
-- ##############################################
|
||||
|
||||
local function get_alert_triggered_key(type_info)
|
||||
if((type_info == nil) or (type_info.alert_type == nil)) then
|
||||
tprint(debug.traceback())
|
||||
if type_info == nil or type_info.alert_type == nil or type_info.alert_type.alert_key == nil then
|
||||
if type_info == nil then traceError(TRACE_ERROR, TRACE_CONSOLE, "type_info is nil") end
|
||||
if type_info.alert_type == nil then traceError(TRACE_ERROR, TRACE_CONSOLE, "type_info.alert_type is nil") end
|
||||
if type_info.alert_type.alert_key == nil then traceError(TRACE_ERROR, TRACE_CONSOLE, "type_info.alert_type.alert_key is nil") end
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, debug.traceback())
|
||||
end
|
||||
|
||||
return(string.format("%d@%s", type_info.alert_type.alert_key, type_info.alert_subtype or ""))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue