Commit 1b83fe9e authored by Matija Obreza's avatar Matija Obreza
Browse files

Improved checking of existing columns

parent 045f5cc3
......@@ -280,9 +280,13 @@ public class DwcaBuilder extends AbstractModelObject {
}
for (Column loadedColumn : loadedColumns) {
if (!columnList.contains(loadedColumn)) {
columnList.add(loadedColumns.indexOf(loadedColumn), loadedColumn);
if (columnList.size() == 0) {
columnList.add(loadedColumn);
} else if (!columnList.contains(loadedColumn)) {
int pos = loadedColumns.indexOf(loadedColumn);
if (pos < 0)
pos = columnList.size() - 1;
columnList.add(Math.min(pos, columnList.size() - 1), loadedColumn);
}
}
sourceSheet.setColumns(columnList);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment