null pointer when filtering an empty list