Skip to content

Commit

Permalink
fix: NPE on nil options
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Dec 12, 2023
1 parent 91e51ed commit 8446e8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beanstalkjobs/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ func (d *Driver) unpack(id uint64, data []byte, out *Item) {
return
}

if out.Options == nil {
out.Options = &Options{}
}

if out.Options.Priority == 0 {
out.Options.Priority = d.priority
}
Expand Down

0 comments on commit 8446e8c

Please sign in to comment.