From 6abba6163290b58cd9ebae98d8459ac38ef52a4b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 18 Jul 2009 21:58:41 +0000 Subject: [PATCH] libs/nixio: allow calls to nixio.util.consume() with no iterator given --- libs/nixio/lua/nixio/util.lua | 6 ++++-- 1 file 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 -- 2.25.1