From ba6734d5ad9ee19d971ac66fc74fbcb4788c22d6 Mon Sep 17 00:00:00 2001 From: ollo Date: Fri, 3 May 2019 20:45:16 +0200 Subject: [PATCH] refactoring displayword to a module --- displayword.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/displayword.lua b/displayword.lua index 0b446ca..255efa5 100644 --- a/displayword.lua +++ b/displayword.lua @@ -46,6 +46,10 @@ local data={} local generateLEDs = function(words, colorForground, colorMin1, colorMin2, colorMin3, colorMin4) -- Set the local variables needed for the colored progress bar data={} + + if (words == nil) then + return nil + end local minutes=1 if (words.min1 == 1) then @@ -249,6 +253,7 @@ M = { round = round, drawLEDs = drawLEDs, updateColor = updateColor, + data = data, } end return M \ No newline at end of file