Skip to content

Commit

Permalink
fix bug: Null pointer from hh caused panic #3
Browse files Browse the repository at this point in the history
  • Loading branch information
andyli029 authored and chengshiwen committed May 25, 2023
1 parent 529251f commit 35b1f1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/hh/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,10 @@ func (l *segment) lastModified() (time.Time, error) {
l.mu.RLock()
defer l.mu.RUnlock()

if l.file == nil {
return time.Time{}, ErrNotOpen
}

stats, err := os.Stat(l.file.Name())
if err != nil {
return time.Time{}, err
Expand Down

0 comments on commit 35b1f1c

Please sign in to comment.