you need to be careful here you might have a filter that is wrapped but not a query than you get a NPE here