From 3686f74bcbe226aeae7f10f3394f5925ea2a1df0 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Sun, 19 Jun 2016 12:10:38 +1000 Subject: [PATCH] Fix conflicting messages --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 815976e..7886c49 100644 --- a/main.go +++ b/main.go @@ -70,13 +70,13 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) { var s string err = db.QueryRow("select data from pastebin where id=?", param1).Scan(&s) db.Close() - if err == sql.ErrNoRows { - io.WriteString(w, "Error invalid paste") - } else { - check(err) - } + check(err) if param1 != "" { + + if err == sql.ErrNoRows { + io.WriteString(w, "Error invalid paste") + } if param2 != "" { highlight := pygments.Highlight(html.UnescapeString(s), param2, "html", "full, style=autumn,linenos=True, lineanchors=True,anchorlinenos=True,", "utf-8") io.WriteString(w, highlight)