From bc3193009feb75cb1cd773821ed77b4025ef446d Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Thu, 30 Jul 2015 15:52:10 +0100 Subject: [PATCH] Fixing build issues --- web.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web.go b/web.go index 2e630fd..805b71e 100644 --- a/web.go +++ b/web.go @@ -49,8 +49,16 @@ func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) { if uname == nil { fmt.Fprintf(w, "Invalid Token") } else { - t, _ := template.ParseFiles("index.html") - t.Execute(w, &Page{"http://" + getIP() + ":" + strconv.Itoa(web.port) + "/", r.URL.Path[1:]}) + t, err := template.ParseFiles("index.html") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + err = t.Execute(w, &Page{"http://" + getIP() + ":" + strconv.Itoa(web.port) + "/", r.URL.Path[1:]}) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } } }