From 26b23e2586a690afb369cc08db464a50da879d04 Mon Sep 17 00:00:00 2001 From: lhui1991 Date: Thu, 5 Aug 2021 00:57:24 +0800 Subject: [PATCH] fix panic in func RowMap (#157) Co-authored-by: lihui7968 --- hive.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hive.go b/hive.go index c73e0cf..4ee7705 100644 --- a/hive.go +++ b/hive.go @@ -630,6 +630,9 @@ func (c *Cursor) RowMap(ctx context.Context) map[string]interface{} { } d := c.Description() + if c.Err != nil || len(d) != len(c.queue) { + return nil + } m := make(map[string]interface{}, len(c.queue)) for i := 0; i < len(c.queue); i++ { columnName := d[i][0]