Selaa lähdekoodia

:art: 保存命名查询判空

Liang Ding 2 vuotta sitten
vanhempi
commit
2e0a9f8c43
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      kernel/model/storage.go

+ 5 - 0
kernel/model/storage.go

@@ -17,6 +17,7 @@
 package model
 
 import (
+	"errors"
 	"os"
 	"path/filepath"
 	"sync"
@@ -206,6 +207,10 @@ func RemoveCriterion(name string) (err error) {
 }
 
 func SetCriterion(criterion *Criterion) (err error) {
+	if "" == criterion.Name {
+		return errors.New(Conf.Language(142))
+	}
+
 	criteriaLock.Lock()
 	defer criteriaLock.Unlock()