aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r--lualib/lua_util.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index cf4636aa2..5bf8dc026 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -559,8 +559,10 @@ exports.extract_specific_urls = function(task, lim, need_emails, filter, prefix)
-- We can get urls based on their eslds
while lim > 0 do
for _,lurls in pairs(eslds) do
- table.insert(res, table.remove(lurls))
- lim = lim - 1
+ if #lurls > 0 then
+ table.insert(res, table.remove(lurls))
+ lim = lim - 1
+ end
end
end
@@ -571,8 +573,10 @@ exports.extract_specific_urls = function(task, lim, need_emails, filter, prefix)
if ntlds <= lim then
while lim > 0 do
for _,lurls in pairs(tlds) do
- table.insert(res, table.remove(lurls))
- lim = lim - 1
+ if #lurls > 0 then
+ table.insert(res, table.remove(lurls))
+ lim = lim - 1
+ end
end
end