redisearch-go
redisearch-go copied to clipboard
Prevent panic when lst (arr[idIdx+fieldsIdx]) is nil in loadDocument()
When using Search(), loadDocument is called where it loads fields and values through type casting. However, it doesn't do a nil check before casting arr[idIdx+fieldsIdx]
into a []interface{}
. Under specific circumstances without a comma ok check, the library will panic with the error panic: interface conversion: interface {} is nil, not []interface {}
. This PR adds a comma ok check before casting lst to []interface{}
.