Don't add empty values to the index

This commit is contained in:
Ilja Neumann
2020-10-14 18:03:52 +02:00
parent 755bbd7817
commit c31732872d
+3
View File
@@ -73,6 +73,9 @@ func (i Indexer) Add(t interface{}) error {
for _, idx := range indices {
pkVal := valueOf(t, fields.PKFieldName)
idxByVal := valueOf(t, idx.IndexBy())
if idxByVal == "" {
continue
}
if _, err := idx.Add(pkVal, idxByVal); err != nil {
return err
}