Skip to content

Commit

Permalink
fix panic with reset on nil receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseCoretta committed Aug 30, 2023
1 parent 9dca86e commit d902be0
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 @@ -442,6 +442,10 @@ func (r Stack) Reset() {
reset is a private method called by Stack.Reset.
*/
func (r *stack) reset() {
if r.isZero() {
return
}

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

0 comments on commit d902be0

Please sign in to comment.