mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-10 00:42:14 +00:00
Add nil checks
This commit is contained in:
parent
e82c66fb7c
commit
eebf8674ac
2 changed files with 11 additions and 5 deletions
|
|
@ -2718,6 +2718,10 @@ function processAlertNotifications(now, periodic_frequency, force_export)
|
|||
|
||||
local message = json.decode(json_message)
|
||||
|
||||
if(not message) then
|
||||
goto continue
|
||||
end
|
||||
|
||||
interface.select(tostring(message.ifid))
|
||||
|
||||
if((message.rowid ~= nil) and (message.table_name ~= nil)) then
|
||||
|
|
|
|||
|
|
@ -157,11 +157,13 @@ function alerts_api.checkPendingStoreAlerts(deadline)
|
|||
|
||||
local alert = json.decode(alert_json)
|
||||
|
||||
interface.storeAlert(
|
||||
alert.alert_tstamp, alert.alert_tstamp_end, alert.alert_granularity,
|
||||
alert.alert_type, alert.alert_subtype, alert.alert_severity,
|
||||
alert.alert_entity, alert.alert_entity_val,
|
||||
alert.alert_json)
|
||||
if(alert) then
|
||||
interface.storeAlert(
|
||||
alert.alert_tstamp, alert.alert_tstamp_end, alert.alert_granularity,
|
||||
alert.alert_type, alert.alert_subtype, alert.alert_severity,
|
||||
alert.alert_entity, alert.alert_entity_val,
|
||||
alert.alert_json)
|
||||
end
|
||||
|
||||
if(os.time() > deadline) then
|
||||
return(false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue