Skip to content

Commit

Permalink
GMP-809 nil document check on load
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpcox authored May 24, 2023
2 parents c719394 + 116870d commit 4112a87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion redisearch/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ func loadDocument(arr []interface{}, idIdx, scoreIdx, payloadIdx, fieldsIdx int)
}

if fieldsIdx > 0 {
lst := arr[idIdx+fieldsIdx].([]interface{})
lst, ok := arr[idIdx+fieldsIdx].([]interface{})
if !ok && arr[idIdx+fieldsIdx] == nil {
return doc, fmt.Errorf("document was nil")
}
doc.loadFields(lst)
}

Expand Down

0 comments on commit 4112a87

Please sign in to comment.