fix: handle edge case where the Protocol config map has no configs, but we are creating a default configuration for a protocol.

This commit is contained in:
Derrick Hammer 2024-03-26 00:18:42 -04:00
parent c9531bc588
commit 73247a86fd
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -92,6 +92,10 @@ func (m *Manager) ConfigureProtocol(name string, cfg ProtocolConfig) error {
return err return err
} }
if m.root.Protocol == nil {
m.root.Protocol = make(map[string]interface{})
}
m.root.Protocol[name] = cfg m.root.Protocol[name] = cfg
return nil return nil