From 955359b073bfb1f6fb80e2bd9fb06debeb4242c0 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sat, 10 Aug 2019 19:38:57 -0300 Subject: [PATCH] Fix nil panic bug when assigning global var and no var is declared on the Taskfile Closes #229 Ref #234 --- internal/taskfile/taskfile.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/taskfile/taskfile.go b/internal/taskfile/taskfile.go index b3869fbd..6da09dd0 100644 --- a/internal/taskfile/taskfile.go +++ b/internal/taskfile/taskfile.go @@ -40,5 +40,8 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error { if tf.Expansions <= 0 { tf.Expansions = 2 } + if tf.Vars == nil { + tf.Vars = make(Vars) + } return nil }