plugins.disco: Fix disco_local_services() to call callback with empty array in case of disco error

Thu, 30 Dec 2010 20:19:47 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 30 Dec 2010 20:19:47 +0000
changeset 172
1a32e9ae79d0
parent 171
741f5311d30c
child 173
3112a9e450ac

plugins.disco: Fix disco_local_services() to call callback with empty array in case of disco error

plugins/disco.lua file | annotate | diff | comparison | revisions
--- a/plugins/disco.lua	Thu Dec 30 20:18:47 2010 +0000
+++ b/plugins/disco.lua	Thu Dec 30 20:19:47 2010 +0000
@@ -160,6 +160,9 @@
 	
 	function stream:disco_local_services(callback)
 		self:disco_items(self.host, nil, function (items)
+			if not items then
+				return callback({});
+			end
 			local n_items = 0;
 			local function item_callback()
 				n_items = n_items - 1;

mercurial