diff --git a/src/main/java/com/socrata/datasync/model/CSVModel.java b/src/main/java/com/socrata/datasync/model/CSVModel.java index acbe4003..6eda277f 100644 --- a/src/main/java/com/socrata/datasync/model/CSVModel.java +++ b/src/main/java/com/socrata/datasync/model/CSVModel.java @@ -151,7 +151,15 @@ public void setValueAt(Object value, int row, int col){ public String getColumnPreview(int columnIndex, int itemsToPreview){ StringBuffer buf = new StringBuffer(); for (int i = 0; i < Math.min(itemsToPreview,getRowCount()); i++){ - buf.append(getValueAt(i,columnIndex)); + Object value = "N/A"; + try + { + value = getValueAt(i,columnIndex); + } + catch (ArrayIndexOutOfBoundsException e){ + System.out.println("Row contains different number of columns than expected. Rows with missing data will be displayed as \"N/A\" in the map fields dialog"); + } + buf.append(value); if (i+1 < Math.min(itemsToPreview,getRowCount())) buf.append(", "); }