From 0c562ba98ad191699c4c48efd079465887567ef0 Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Fri, 13 Jul 2018 20:40:33 +0200 Subject: [PATCH] fix null dereference --- pkg/types/properties.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/types/properties.go b/pkg/types/properties.go index 696336819..748f9d536 100644 --- a/pkg/types/properties.go +++ b/pkg/types/properties.go @@ -27,14 +27,26 @@ func (p Properties) Set(key string, value interface{}) Properties { switch v := value.(type) { case *string: + if v == nil { + return p + } p[key] = *v case []byte: p[key] = string(v) case *bool: + if v == nil { + return p + } p[key] = fmt.Sprint(*v) case *int64: + if v == nil { + return p + } p[key] = fmt.Sprint(*v) case *int: + if v == nil { + return p + } p[key] = fmt.Sprint(*v) default: // Fallback to Stringer interface. This produces gibberish on pointers,