# HG changeset patch # User Kim Alvefur # Date 1768341314 -3600 # Node ID d8a30fdfbddda5c4d39910769724cb134a1d20a9 # Parent 2afb278326cee04f9129a614f5ba3cd6768aaca9 util.prosodyctl.check: Fix #1978 Fixes an error that occurs when modules_enabled is not present in the global section nor in a Component section, leading to an attempt to index nil. diff -r 2afb278326ce -r d8a30fdfbddd util/prosodyctl/check.lua --- a/util/prosodyctl/check.lua Mon Jan 12 18:02:51 2026 +0000 +++ b/util/prosodyctl/check.lua Tue Jan 13 22:55:14 2026 +0100 @@ -475,7 +475,6 @@ "websocket_get_response_text", }); local config = configmanager.getconfig(); - local global = api("*"); -- Check that we have any global options (caused by putting a host at the top) if it.count(it.filter("log", pairs(config["*"]))) == 0 then ok = false; @@ -538,9 +537,8 @@ end do -- Check for modules enabled both normally and as components - local modules = global:get_option_set("modules_enabled"); - for host, options in enabled_hosts() do - local component_module = options.component_module; + for host in enabled_hosts() do + local modules, component_module = modulemanager.get_modules_for_host(host); if component_module and modules:contains(component_module) then print((" mod_%s is enabled both in modules_enabled and as Component %q %q"):format(component_module, host, component_module)); print(" This means the service is enabled on all VirtualHosts as well as the Component.");