Fix for avoiding invalid table content in hosts page

This commit is contained in:
Luca Deri 2023-02-26 10:06:29 +01:00
parent 42d8bc2073
commit d6eedc2f09

View file

@ -213,8 +213,10 @@ if(hosts_stats ~= nil) then
elseif custom_column_utils.isCustomColumn(sortColumn) then
custom_column_key, custom_column_format = custom_column_utils.label2criteriakey(sortColumn)
local val = custom_column_utils.hostStatsToColumnValue(hosts_stats[key], custom_column_key, false)
if(val == nil) then val = 0 end -- Just to avoid invalid table values
if tonumber(val) then
if(tonumber(val)) then
vals[val + postfix] = key
else
vals[val..postfix] = key