Added null check to fix crash in BuildGeometryFilter (issue #547).