fix #3187: NPE in distance filter