From 0b94137bddd287e01f7322548eabfcb888459c15 Mon Sep 17 00:00:00 2001 From: httpjamesm Date: Mon, 16 Oct 2023 16:57:36 -0400 Subject: [PATCH] fix: do comma ok []interface{} assert check --- redisearch/document.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/redisearch/document.go b/redisearch/document.go index c45e461..f5b6d95 100644 --- a/redisearch/document.go +++ b/redisearch/document.go @@ -105,8 +105,9 @@ func loadDocument(arr []interface{}, idIdx, scoreIdx, payloadIdx, fieldsIdx int) } if fieldsIdx > 0 { - lst := arr[idIdx+fieldsIdx].([]interface{}) - doc.loadFields(lst) + if lst, ok := arr[idIdx+fieldsIdx].([]interface{}); ok { + doc.loadFields(lst) + } } return doc, nil