File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
3737- Datetime location after encode + decode is unequal (#217 )
3838- Wrong interval arithmetic with timezones (#221 )
3939- Invalid MsgPack if STREAM_ID > 127 (#224 )
40+ - queue.Take() returns an invalid task (#222 )
4041
4142## [ 1.8.0] - 2022-08-17
4243
Original file line number Diff line number Diff line change @@ -467,6 +467,14 @@ func (qd *queueData) DecodeMsgpack(d *decoder) error {
467467 }
468468
469469 qd .task = & Task {data : qd .result , q : qd .q }
470- d .Decode (& qd .task )
470+ if err = d .Decode (& qd .task ); err != nil {
471+ return err
472+ }
473+
474+ if qd .task .Data () == nil {
475+ // It may happen if the decoder has a code.Nil value inside. As a
476+ // result, the task will not be decoded.
477+ qd .task = nil
478+ }
471479 return nil
472480}
Original file line number Diff line number Diff line change @@ -29,13 +29,9 @@ func (t *Task) DecodeMsgpack(d *decoder) error {
2929 return err
3030 }
3131 if t .data != nil {
32- if err = d .Decode (t .data ); err != nil {
33- return fmt .Errorf ("fffuuuu: %s" , err )
34- }
35- } else {
36- if t .data , err = d .DecodeInterface (); err != nil {
37- return err
38- }
32+ d .Decode (t .data )
33+ } else if t .data , err = d .DecodeInterface (); err != nil {
34+ return err
3935 }
4036 return nil
4137}
You can’t perform that action at this time.
0 commit comments