Skip to content

Commit

Permalink
fix: npe in ants removal
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumemichel authored and dennis-tra committed Jan 14, 2025
1 parent b6b8055 commit 85fe84d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions queen.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ func (q *Queen) routine(ctx context.Context) {
logger.Debugf("removing %d ants", len(excessAntsIndices))

// kill ants that are not needed anymore
// sort indices in descending order to remove from end first
sort.Sort(sort.Reverse(sort.IntSlice(excessAntsIndices)))
returnedKeys := make([]crypto.PrivKey, len(excessAntsIndices))
for i, index := range excessAntsIndices {
ant := q.ants[index]
Expand Down

0 comments on commit 85fe84d

Please sign in to comment.