From 3e3be5e2a3096203643e273a94c2d65f3ee743d7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 11 Aug 2014 21:55:47 -0700 Subject: [PATCH] config: only walk if non-nil --- config/config.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/config.go b/config/config.go index b89ffcf29..102e18163 100644 --- a/config/config.go +++ b/config/config.go @@ -127,11 +127,13 @@ func (c *Config) Validate() error { } w := &interpolationWalker{F: fn} - if err := reflectwalk.Walk(v.Default, w); err == nil { - if interp { - errs = append(errs, fmt.Errorf( - "Variable '%s': cannot contain interpolations", - v.Name)) + if v.Default != nil { + if err := reflectwalk.Walk(v.Default, w); err == nil { + if interp { + errs = append(errs, fmt.Errorf( + "Variable '%s': cannot contain interpolations", + v.Name)) + } } } }