Skip to content

Commit

Permalink
Trim space in node
Browse files Browse the repository at this point in the history
  • Loading branch information
bynil committed Oct 30, 2019
1 parent c80e4ff commit 68a907d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func InitCollection() {
// findNodeId search node id in mongodb, node could be node's name, title, title_alternative,
// return error if node not found.
func findNodeId(node string) (nodeId int64, err error) {
node = strings.TrimSpace(node)
if node == "" {
return nodeId, errors.New("empty node name")
}
Expand Down

0 comments on commit 68a907d

Please sign in to comment.