fix nil deref

This commit is contained in:
marco 2024-02-07 11:37:52 +01:00
parent f82c5f34d3
commit 084c01ddc7

View file

@ -335,7 +335,7 @@ func Serve(cConfig *csconfig.Config, agentReady chan bool) error {
} }
// XXX: just pass the CTICfg // XXX: just pass the CTICfg
if cConfig.API.CTI != nil && *cConfig.API.CTI.Enabled { if cConfig.API.CTI != nil && cConfig.API.CTI.Enabled != nil && *cConfig.API.CTI.Enabled {
log.Infof("Crowdsec CTI helper enabled") log.Infof("Crowdsec CTI helper enabled")
if err := exprhelpers.InitCrowdsecCTI(cConfig.API.CTI.Key, cConfig.API.CTI.CacheTimeout, cConfig.API.CTI.CacheSize, cConfig.API.CTI.LogLevel); err != nil { if err := exprhelpers.InitCrowdsecCTI(cConfig.API.CTI.Key, cConfig.API.CTI.CacheTimeout, cConfig.API.CTI.CacheSize, cConfig.API.CTI.LogLevel); err != nil {