fix genNameAndNoteByResources when note is blank

This commit is contained in:
UlricQin 2021-01-06 12:17:06 +08:00
parent a8008a9418
commit e0263edc54
1 changed files with 6 additions and 2 deletions

View File

@ -310,8 +310,12 @@ func genNameAndNoteByResources(resources []models.Resource) (name, note string)
notes = config.Set(notes)
if len(resources) == 1 {
name = names[0]
note = notes[0]
if len(names) > 0 {
name = names[0]
}
if len(notes) > 0 {
note = notes[0]
}
return
}
name = fmt.Sprintf("%s%v", strings.Join(names, ","), len(names))