From b5065874bcc0257ec10e7a98c8132235837b9193 Mon Sep 17 00:00:00 2001 From: vishalnayak Date: Tue, 10 May 2016 20:33:58 -0400 Subject: [PATCH] Skip a nil item during filtering --- hcl/ast/ast.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hcl/ast/ast.go b/hcl/ast/ast.go index f8bb71a..0eca817 100644 --- a/hcl/ast/ast.go +++ b/hcl/ast/ast.go @@ -56,7 +56,7 @@ func (o *ObjectList) Filter(keys ...string) *ObjectList { var result ObjectList for _, item := range o.Items { // If there aren't enough keys, then ignore this - if len(item.Keys) < len(keys) { + if item == nil || len(item.Keys) < len(keys) { continue }