cmd: fix build nil check

This commit is contained in:
c9s 2021-01-23 01:01:36 +08:00
parent 3cb3cd79fa
commit cc3e9f42aa

View File

@ -253,7 +253,7 @@ func run(cmd *cobra.Command, args []string) error {
} }
// for wrapper binary, we can just run the strategies // for wrapper binary, we can just run the strategies
if bbgo.IsWrapperBinary || len(userConfig.Build.Imports) == 0 || noCompile { if bbgo.IsWrapperBinary || (userConfig.Build != nil && len(userConfig.Build.Imports) == 0) || noCompile {
userConfig, err = bbgo.Load(configFile, true) userConfig, err = bbgo.Load(configFile, true)
if err != nil { if err != nil {
return err return err