added null check to filter

Now we don’t get errors if there is an empty item.