From e0bb49aa23bedb4e8231671e1406af2e25cc0388 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 15 May 2017 11:32:20 +0000 Subject: [PATCH] Don't crash on nil proxy in StatusHTTP --- prog/weaver/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prog/weaver/main.go b/prog/weaver/main.go index 8ab4efe1..7e7d5dcf 100644 --- a/prog/weaver/main.go +++ b/prog/weaver/main.go @@ -442,7 +442,9 @@ func main() { HandleHTTP(muxRouter, version, router, allocator, defaultSubnet, ns, dnsserver, &waitReady) HandleHTTPPeer(muxRouter, allocator, discoveryEndpoint, token, name.String()) muxRouter.Methods("GET").Path("/metrics").Handler(metricsHandler(router, allocator, ns, dnsserver)) - muxRouter.Methods("GET").Path("/proxyaddrs").HandlerFunc(proxy.StatusHTTP) + if proxy != nil { + muxRouter.Methods("GET").Path("/proxyaddrs").HandlerFunc(proxy.StatusHTTP) + } http.Handle("/", common.LoggingHTTPHandler(muxRouter)) Log.Println("Listening for HTTP control messages on", httpAddr) go listenAndServeHTTP(httpAddr, nil)