From 31856f1b1671470c3b0dd77ced0108eb7c061ae4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Maneiro?= <amaneiro@icarto.es>
Date: Thu, 20 Jun 2013 18:50:28 +0200
Subject: [PATCH] libFMap: also check for NULL bounding boxes

---
 .../fmap/edition/VectorialEditableAdapter.java     |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableAdapter.java b/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableAdapter.java
index 1f5364a..cf7d014 100644
--- a/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableAdapter.java
+++ b/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableAdapter.java
@@ -566,15 +566,18 @@ public class VectorialEditableAdapter extends EditableAdapter implements
 			// expansionFile.invalidateRow(num);
 		}
 		System.err.println("Elimina una Row en la posición: " + index);
-		// Se actualiza el índice
+		// Index is updated:
+		// feat + geom + bounding box should not be null
+		// Note: bounding box can be null for a FGeometryCollection geom 
+		// which happens to not be null but has 0 geometries
 		if (feat != null) {
 		    IGeometry g = feat.getGeometry();
 			if (g != null) {
 			    Rectangle2D r = g.getBounds2D();
-			    this.fmapSpatialIndex.delete(r, new Integer(index));
-			    //System.out.println("Está borrado : " + borrado);
-			    //System.out.println("Index.lenght : " + this.index.size());
-			    isFullExtentDirty = true;
+			    if(r != null) {
+				this.fmapSpatialIndex.delete(r, new Integer(index));
+				isFullExtentDirty = true;
+			    }
 			}
 		}
 		setSelection(new FBitSet());
-- 
1.7.1

