Skip to content

Commit 794dcd2

Browse files
committed
cosmetics
1 parent ce49cd8 commit 794dcd2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

server/settings/xpathdbrouter.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,17 @@ func (v *XPathDBRouter) RegisterRoute(db TorrServerDB, xPath string) error {
5555
sort.Slice(v.routes, func(iLeft, iRight int) bool {
5656
return len(v.routes[iLeft]) > len(v.routes[iRight])
5757
})
58-
v.log(fmt.Sprintf("Registered new route \"%s\" for DB \"%s\", total %d routes", newRoute, v.getDBName(db), len(v.routes)))
58+
v.log(fmt.Sprintf("Registered new route \"%s\" for DB \"%s\", total %d routes", getDefaultRoureName(newRoute), v.getDBName(db), len(v.routes)))
5959
return nil
6060
}
6161

62+
func getDefaultRoureName(route string) string {
63+
if len(route) > 0 {
64+
return route
65+
}
66+
return "default"
67+
}
68+
6269
func (v *XPathDBRouter) xPathToRoute(xPath string) string {
6370
return strings.ToLower(strings.TrimSpace(xPath))
6471
}

0 commit comments

Comments
 (0)