mod_http: Fix traceback when no HTTP services succeed in binding
authorMatthew Wild <mwild1@gmail.com>
Sat, 26 May 2012 19:49:43 +0100
changeset 4915 3fbc01d1fc5a
parent 4914 2e9b16b2ae00
child 4916 31496e8227e8
mod_http: Fix traceback when no HTTP services succeed in binding
plugins/mod_http.lua
--- a/plugins/mod_http.lua	Sat May 26 19:41:17 2012 +0100
+++ b/plugins/mod_http.lua	Sat May 26 19:49:43 2012 +0100
@@ -44,7 +44,7 @@
 	app_name = app_name or (module.name:gsub("^http_", ""));
 	local ext = url_parse(module:get_option_string("http_external_url")) or {};
 	local services = portmanager.get_active_services();
-	local http_services = services:get("https") or services:get("http");
+	local http_services = services:get("https") or services:get("http") or {};
 	for interface, ports in pairs(http_services) do
 		for port, services in pairs(ports) do
 			local path = get_base_path(module, app_name, default_path or "/"..app_name);