Browse Source

图片名称去重处理

gmy 3 months ago
parent
commit
190c380646
1 changed files with 1 additions and 1 deletions
  1. 1 1
      models/image_conf.go

+ 1 - 1
models/image_conf.go

@@ -31,7 +31,7 @@ func BatchAddImageMaterials(items []*ImageConf, batchSize int) (err error) {
 func GetImageConfByName(imageName string) (item *ImageConf, err error) {
 	item = &ImageConf{}
 	err = global.DmSQL["rddp"].Where("image_name = ?", imageName).First(item).Error
-	if err.Error() == "record not found" {
+	if err != nil && err.Error() == "record not found" {
 		return nil, nil
 	}
 	return item, nil