From e11c40eee461141e0348c234059b327075e19b2a Mon Sep 17 00:00:00 2001 From: astaxie Date: Sat, 12 Oct 2013 16:56:30 +0800 Subject: [PATCH] fix #244 --- filter.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/filter.go b/filter.go index 16329709..2387e3a7 100644 --- a/filter.go +++ b/filter.go @@ -26,8 +26,10 @@ func (mr *FilterRouter) ValidRouter(router string) bool { return true } matches := mr.regex.FindStringSubmatch(router) - if len(matches[0]) == len(router) { - return true + if len(matches) > 0 { + if len(matches[0]) == len(router) { + return true + } } } return false