fix #3187: NPE in distance filter
Merge branch 'release' into upstream