summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libs/nixio/lua/nixio/util.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/nixio/lua/nixio/util.lua b/libs/nixio/lua/nixio/util.lua
index d83209aff..ecefb4c97 100644
--- a/libs/nixio/lua/nixio/util.lua
+++ b/libs/nixio/lua/nixio/util.lua
@@ -28,8 +28,10 @@ local ZBUG = uname.sysname == "Linux" and uname.release:sub(1, 3) == "2.4"
function consume(iter, append)
local tbl = append or {}
- for obj in iter do
- tbl[#tbl+1] = obj
+ if iter then
+ for obj in iter do
+ tbl[#tbl+1] = obj
+ end
end
return tbl
end