From c451e1525408d455987915fd66d406905e9e0815 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Fri, 30 Aug 2024 17:43:10 -0400 Subject: [PATCH] Catch number parsing and fall back to page 1 in peersHandler Closes #14 --- http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 4b86876..205ed55 100644 --- a/http.go +++ b/http.go @@ -300,7 +300,10 @@ func Serve(actors map[string]Actor) { if pageS == "" { page = 0 } else { - page, _ = strconv.Atoi(pageS) + page, err = strconv.Atoi(pageS) + if err != nil { + page = 1 + } } response, _ := actor.getPeers(page, collection) w.Write(response)