fix(dep): prevent nil pointer panic in --json mode (GH#998)
warnIfCyclesExist was called with nil storage when using daemon mode. Add nil check to skip cycle warning in daemon mode (daemon handles it). Fixes #998 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1497
.beads/issues.jsonl
1497
.beads/issues.jsonl
File diff suppressed because one or more lines are too long
@@ -45,6 +45,9 @@ func isChildOf(childID, parentID string) bool {
|
||||
|
||||
// warnIfCyclesExist checks for dependency cycles and prints a warning if found.
|
||||
func warnIfCyclesExist(s storage.Storage) {
|
||||
if s == nil {
|
||||
return // Skip cycle check in daemon mode (daemon handles it)
|
||||
}
|
||||
cycles, err := s.DetectCycles(rootCtx)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Warning: Failed to check for cycles: %v\n", err)
|
||||
|
||||
Reference in New Issue
Block a user