Skip to content

Commit

Permalink
bugfix: do not update alias if alias is blank whenendpoint import
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed Apr 25, 2020
1 parent b32775e commit 10cf6d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/model/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ func endpointImport(session *xorm.Session, ident, alias string) error {
}

if has {
endpoint.Alias = alias
_, err = session.Where("ident=?", ident).Cols("alias").Update(endpoint)
if alias != "" {
endpoint.Alias = alias
_, err = session.Where("ident=?", ident).Cols("alias").Update(endpoint)
}
} else {
_, err = session.Insert(Endpoint{Ident: ident, Alias: alias})
}
Expand Down

0 comments on commit 10cf6d9

Please sign in to comment.