Andrea Fazzi 5 anni fa
parent
commit
124b5442c8
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      orm/group.go

+ 2 - 2
orm/group.go

@@ -232,9 +232,9 @@ func (group *Group) executeTeacherQuery() ([]*Teacher, error) {
 		allTeachers []*Teacher
 	)
 
-	fields := strings.Split(group.Query, " ")
+	if group.Query != "" {
 
-	if len(fields) > 0 {
+		fields := strings.Split(group.Query, " ")
 
 		if err := DB().Find(&allTeachers).Error; err != nil {
 			return nil, err