[KARAF-2995]ensure filter isn't empty
(cherry picked from commit eacb51caced4591abadac73bf574ae8a93d17ec9)