Fix crash in geoprocessing