# HG changeset patch # User Kim Alvefur # Date 1572699338 -3600 # Node ID a832335592531696b7aa8a425121ac6c45a25b58 # Parent 51ea82f553222f95fdb0e07e8fc03065c0b2709c core.configmanager: Ensure Hosts are given names Prevents traceback from nameprep(nil) diff -r 51ea82f55322 -r a83233559253 core/configmanager.lua --- 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