summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-07-18 21:58:41 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-07-18 21:58:41 +0000
commit6abba6163290b58cd9ebae98d8459ac38ef52a4b (patch)
tree360e80ed708a8517e5d07930b288114cf74b7aa6
parent4bc6b85bb7d1932c5d3df84b7fefeaecbffd213c (diff)
libs/nixio: allow calls to nixio.util.consume() with no iterator given
-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