Instead of checking for not null, I would suggest to check if it is actually a Filter) (or above a query) as you did before in the constructor.