manage when undefined is given to the filter

This pr fix the case when the object is undefined.
I guess you didn't mean to change the name or is this relevant?