Skip to content

Commit

Permalink
Fix panic of bogus removal attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseCoretta committed Sep 2, 2023
1 parent d902be0 commit b012a98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ func (r Stack) Remove(idx int) (slice any, ok bool) {
remove is a private method called by Stack.Remove.
*/
func (r *stack) remove(idx int) (slice any, ok bool) {
if r.isZero() {
return
}

if r.positive(ronly) {
return
}
Expand Down

0 comments on commit b012a98

Please sign in to comment.