hcl: Elem on nil should return nil

This commit is contained in:
Mitchell Hashimoto 2014-08-11 21:11:00 -07:00
parent 99d585c297
commit bf89042e7b

View File

@ -71,6 +71,10 @@ func (o *Object) Elem(expand bool) []*Object {
switch o.Type { switch o.Type {
case ValueTypeObject: case ValueTypeObject:
if o.Value == nil {
return nil
}
return o.Value.([]*Object) return o.Value.([]*Object)
} }