From c75a2327d5890134c48924805096f2aff7b8bb78 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Mon, 2 Feb 2026 12:51:56 -0600 Subject: [PATCH] add check to prevent empty module Id --- router.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/router.go b/router.go index 4dbd5ea..7b72541 100644 --- a/router.go +++ b/router.go @@ -34,6 +34,18 @@ func NewRouter(config config.Config) (*Router, []module.ModuleError, []route.Rou for moduleIndex, moduleDecl := range config.Modules { + if moduleDecl.Id == "" { + if moduleErrors == nil { + moduleErrors = []module.ModuleError{} + } + moduleErrors = append(moduleErrors, module.ModuleError{ + Index: moduleIndex, + Config: moduleDecl, + Error: errors.New("module id cannot be empty"), + }) + continue + } + moduleInfo, ok := module.ModuleRegistry[moduleDecl.Type] if !ok { if moduleErrors == nil {