Skip to content

Commit

Permalink
Update hive.go to avoid nil dereference (#160)
Browse files Browse the repository at this point in the history
Populate msg * string with errormsg on line 424 to avoid nil dereference
  • Loading branch information
luis-barrague-meli authored Aug 6, 2021
1 parent 26b23e2 commit a5e5c59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hive.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ func (c *Cursor) WaitForCompletion(ctx context.Context) {
msg = s.ErrorMessage
}
if msg == nil {
*msg = fmt.Sprintf("gohive: operation in state (%v) without task status or error message", operationStatus.OperationState)
errormsg := fmt.Sprintf("gohive: operation in state (%v) without task status or error message", operationStatus.OperationState)
msg = &errormsg
}
c.Err = errors.New(*msg)
}
Expand Down

0 comments on commit a5e5c59

Please sign in to comment.