Skip a nil item during filtering

This commit is contained in:
vishalnayak 2016-05-10 20:33:58 -04:00
parent 9a905a34e6
commit b5065874bc

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
}