mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Safety check on bad notification entity_id
This commit is contained in:
parent
6d5a494c4a
commit
9dff936478
1 changed files with 7 additions and 1 deletions
|
|
@ -560,7 +560,13 @@ function alert_utils.formatAlertNotification(notif, options)
|
|||
|
||||
-- entity can be hidden for example when one is OK with just the message
|
||||
if options.show_entity then
|
||||
msg = msg .. " [" .. alert_consts.alertEntityLabel(notif.entity_id) .. "]"
|
||||
local entity_label = alert_consts.alertEntityLabel(notif.entity_id)
|
||||
if not isEmptyString(entity_label) then
|
||||
msg = msg .. " [" .. entity_label .. "]"
|
||||
else
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Unknown entity_id " .. (notif.entity_id or "(none)"))
|
||||
tprint(notif)
|
||||
end
|
||||
end
|
||||
|
||||
local alert_type_label = alert_consts.alertTypeLabel(notif.alert_id, options.nohtml or options.nolabelhtml, notif.entity_id, true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue