From d5dbdb273703a3add0f1c3287aa531854ab30269 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 3 Nov 2017 10:25:38 -0500 Subject: several one-line panic, race, and logic fixes (#7766) --- manualtesting/manual_testing.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'manualtesting/manual_testing.go') diff --git a/manualtesting/manual_testing.go b/manualtesting/manual_testing.go index 75274a24b..20b7a2dfd 100644 --- a/manualtesting/manual_testing.go +++ b/manualtesting/manual_testing.go @@ -138,18 +138,16 @@ func manualTest(c *api.Context, w http.ResponseWriter, r *http.Request) { // Grab the test ID and pick the test testname, ok := params["test"] - var err2 *model.AppError + if !ok { + c.Err = model.NewAppError("/manual", "manaultesting.manual_test.parse.app_error", nil, "", http.StatusBadRequest) + return + } + switch testname[0] { case "autolink": - err2 = testAutoLink(env) + c.Err = testAutoLink(env) // ADD YOUR NEW TEST HERE! case "general": - err2 = nil - } - - if err != nil { - c.Err = err2 - return } } -- cgit v1.2.3-1-g7c22