Prevented empty filters from causing NPE

 Closes #3724