Skip to content

FIX: [run] check for nil strategy instances when loading strategies - #2709

Merged
c9s merged 2 commits into
mainfrom
dboy/run/nil-strategy-check
Oct 20, 2026
Merged

c9s merged 2 commits into
mainfrom
dboy/run/nil-strategy-check

Conversation

@dboyliao

Copy link
Copy Markdown
Collaborator

Summary

Add nil checks for strategy instances when loading strategy configurations to prevent nil strategies from being appended to config.CrossExchangeStrategies and config.ExchangeStrategies.

Key Changes

  • pkg/bbgo/config.go:
    • In loadCrossExchangeStrategies: Check whether the type-asserted CrossExchangeStrategy instance is nil and return an error if so, preventing nil instances from being appended to config.CrossExchangeStrategies.
    • In loadExchangeStrategies: Validate that singleExchangeStrategyInstance is not nil before creating the ExchangeStrategyMount and appending it to config.ExchangeStrategies.

@dboyliao
dboyliao requested a review from c9s as a code owner October 20, 2026 07:34
@c9s
c9s merged commit a29651b into main Oct 20, 2026
2 checks passed
@c9s
c9s deleted the dboy/run/nil-strategy-check branch October 20, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants