From a5e5c59c8d62dce9f50dd68bf1751209def75a79 Mon Sep 17 00:00:00 2001 From: luis-barrague-meli Date: Fri, 6 Aug 2021 19:00:56 -0300 Subject: [PATCH] Update hive.go to avoid nil dereference (#160) Populate msg * string with errormsg on line 424 to avoid nil dereference --- hive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hive.go b/hive.go index 4ee7705..a81133c 100644 --- a/hive.go +++ b/hive.go @@ -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) }