# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1335561500 -3600
# Node ID da3c1d980c0444848b60e1bcfafa4474e379f53b
# Parent  7c81b04a4fed31a5b798a57e05e4b267dd49e140
mod_proxy65: Fix traceback when proxy65 service fails to bind a port

diff -r 7c81b04a4fed -r da3c1d980c04 plugins/mod_proxy65.lua
--- a/plugins/mod_proxy65.lua	Fri Apr 27 21:37:45 2012 +0100
+++ b/plugins/mod_proxy65.lua	Fri Apr 27 22:18:20 2012 +0100
@@ -91,7 +91,7 @@
 	local host, name = module:get_host(), module:get_option_string("name", "SOCKS5 Bytestreams Service");
 	
 	local proxy_address = module:get_option("proxy65_address", host);
-	local proxy_port = module:get_option_number("proxy65_port", next(portmanager.get_active_services():search("proxy65", nil)[1]));
+	local proxy_port = module:get_option_number("proxy65_port", next(portmanager.get_active_services():search("proxy65", nil)[1] or {}));
 	local proxy_acl = module:get_option("proxy65_acl");
 
 	module:add_identity("proxy", "bytestreams", name);