core/configmanager.lua
changeset 10378 a83233559253
parent 10210 46a5f2bf5ee0
child 10379 3d0adbc74c39
--- a/core/configmanager.lua	Sat Nov 02 14:22:06 2019 +0100
+++ b/core/configmanager.lua	Sat Nov 02 13:55:38 2019 +0100
@@ -138,6 +138,9 @@
 
 		rawset(env, "__currenthost", "*") -- Default is global
 		function env.VirtualHost(name)
+			if not name then
+				error("Host must have a name", 2);
+			end
 			name = nameprep(name);
 			if rawget(config_table, name) and rawget(config_table[name], "component_module") then
 				error(format("Host %q clashes with previously defined %s Component %q, for services use a sub-domain like conference.%s",
@@ -156,6 +159,9 @@
 		env.Host, env.host = env.VirtualHost, env.VirtualHost;
 
 		function env.Component(name)
+			if not name then
+				error("Component must have a name", 2);
+			end
 			name = nameprep(name);
 			if rawget(config_table, name) and rawget(config_table[name], "defined")
 				and not rawget(config_table[name], "component_module") then