Fixes nil comparison with script_stats.stats.progress

This commit is contained in:
Simone Mainardi 2020-02-21 18:36:06 +01:00
parent 9280bde0f9
commit 34ee6ca4cf

View file

@ -205,7 +205,7 @@ for key in pairsByValues(sort_to_key, sOrder) do
record["column_ifid"] = string.format("%i", script_stats.ifid)
record["column_time_perc"] = script_stats.stats.perc_duration
if(script_stats.stats.progress > 0) then
if script_stats.stats.progress and script_stats.stats.progress > 0 then
record["column_progress"] = string.format("%i %%", script_stats.stats.progress)
else
-- For now prevent a 0 progress froms being erroneusly reported for unsupported activities