From 84d14dfd505ad2f138f592ee063f873a9fdf1659 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 31 May 2018 09:23:30 +0200 Subject: [PATCH] fix 'string' type not to crash on 'nil' values --- checker/default/string/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/checker/default/string/main.go b/checker/default/string/main.go index ad28da1..89e8086 100644 --- a/checker/default/string/main.go +++ b/checker/default/string/main.go @@ -10,6 +10,10 @@ func Match(name string) bool { func Check(value interface{}) bool { + if value == nil { + return false + } + kind := reflect.TypeOf(value).Kind() return kind == reflect.String