Snap selection to grid: fixed a problem that could cause a crash if geometry got removed by snapping it to the grid