fix notification config check

This commit is contained in:
c9s 2020-10-27 20:41:08 +08:00
parent 6dcb6df7c1
commit 008e5c83f9

View File

@ -114,7 +114,7 @@ func runConfig(ctx context.Context, userConfig *bbgo.Config) error {
// for slack // for slack
slackToken := viper.GetString("slack-token") slackToken := viper.GetString("slack-token")
if len(slackToken) > 0 { if len(slackToken) > 0 && userConfig.Notifications != nil {
if conf := userConfig.Notifications.Slack; conf != nil { if conf := userConfig.Notifications.Slack; conf != nil {
if conf.ErrorChannel != "" { if conf.ErrorChannel != "" {
log.Infof("found slack configured, setting up log hook...") log.Infof("found slack configured, setting up log hook...")