Skip to content

Commit 7aa6099

Browse files
AnnatarHeclaude
andcommitted
fix(gc): add nil check when processing post commands
Skip nil entries in the post commands list to prevent potential nil pointer dereference when accessing RecordingTime. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 773fa43 commit 7aa6099

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

commands/gc.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ func commandGC(c *cli.Context) error {
9494

9595
// save all the data that before cursor
9696
for _, cmd := range postCommands {
97+
if cmd == nil {
98+
continue
99+
}
97100
if cmd.RecordingTime.After(lastCursor) {
98101
newPostCommandList = append(newPostCommandList, cmd)
99102
}

0 commit comments

Comments
 (0)