Fix nil pointer dereference crash in bd sync command (#108)
The sync command was crashing at sync.go:245 with a nil pointer dereference when running in direct mode (without daemon). The exportToJSONL function attempted to use store.SearchIssues() without first ensuring the store was initialized. This fix adds a call to ensureStoreActive() before accessing the store, matching the pattern used by other commands like export. This ensures the store is properly initialized whether running with or without the daemon. Fixes #106 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -258,6 +258,11 @@ func exportToJSONL(ctx context.Context, jsonlPath string) error {
|
||||
}
|
||||
|
||||
// Direct mode: access store directly
|
||||
// Ensure store is initialized
|
||||
if err := ensureStoreActive(); err != nil {
|
||||
return fmt.Errorf("failed to initialize store: %w", err)
|
||||
}
|
||||
|
||||
// Get all issues
|
||||
issues, err := store.SearchIssues(ctx, "", types.IssueFilter{})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user