Possible fix for issue #6962

This commit is contained in:
MatteoBiscosi 2022-11-07 10:55:50 +01:00
parent 05e5b50662
commit b7cb9a3481
3 changed files with 11 additions and 4 deletions

View file

@ -66,6 +66,13 @@ rsp["series"] = series
rsp["labels"] = labels
rsp["colors"] = colors
-- Just in case no data were found put an empty serie
if table.len(rsp["series"]) == 0 then
rsp["series"] = { 0 }
rsp["labels"] = { i18n('no_data_available') }
rsp["colors"] = { graph_utils.get_html_color(#colors + 1) }
end
-- ##################################
rest_utils.answer(rest_utils.consts.success.ok, rsp)