Merge pull request #121 from hashicorp/filter-skip-nil-item

Skip nil items during filtering
This commit is contained in:
James Nugent 2016-09-02 11:32:56 -05:00 committed by GitHub
commit 9edfb078e1

View File

@ -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
}