Catch number parsing and fall back to page 1 in peersHandler

Closes #14
master
Matt Baer 2024-08-30 17:43:10 -04:00
parent a2ffaa73b5
commit c451e15254
1 changed files with 4 additions and 1 deletions

View File

@ -300,7 +300,10 @@ func Serve(actors map[string]Actor) {
if pageS == "" { if pageS == "" {
page = 0 page = 0
} else { } else {
page, _ = strconv.Atoi(pageS) page, err = strconv.Atoi(pageS)
if err != nil {
page = 1
}
} }
response, _ := actor.getPeers(page, collection) response, _ := actor.getPeers(page, collection)
w.Write(response) w.Write(response)