diff --git a/models/resources/storage/storage_mongo_accessor.go b/models/resources/storage/storage_mongo_accessor.go index 88816e5..dfd66a6 100644 --- a/models/resources/storage/storage_mongo_accessor.go +++ b/models/resources/storage/storage_mongo_accessor.go @@ -76,7 +76,7 @@ func (wfa storageMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, error) func (wfa *storageMongoAccessor) Search(filters *dbs.Filters, search string) ([]utils.ShallowDBObject, int, error) { objs := []utils.ShallowDBObject{} - if (len(filters.And) == 0 || len(filters.Or) == 0) && search != "" { + if (filters == nil || len(filters.And) == 0 || len(filters.Or) == 0) && search != "" { filters = &dbs.Filters{ Or: map[string]dbs.Filter{ "abstractresource.abstractobject.name": {Operator: dbs.LIKE.String(), Value: search},