mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-18 19:31:49 +00:00
Address fragility in importing spreadsheets with missing header columns
This commit is contained in:
parent
0be1b6fe3e
commit
269580cf11
@ -116,12 +116,13 @@ public class SheetEditorControllerImpl extends SheetEditorController {
|
||||
}).collect(Collectors.toCollection(editor.getSheet().getColumns()::getColumn));
|
||||
|
||||
editor.getSheet().setRows(new Rows());
|
||||
List<String> header = data.get(0);
|
||||
data.stream().skip(1)
|
||||
.map(cols -> {
|
||||
Row r = new Row();
|
||||
for (int i = 0; i < cols.size(); i++) {
|
||||
if (cols.get(i) != null) {
|
||||
setValue(r.getOtherAttributes(), data.get(0).get(i), cols.get(i));
|
||||
if (cols.get(i) != null && header.size() > i && header.get(i) != null) {
|
||||
setValue(r.getOtherAttributes(), header.get(i), cols.get(i));
|
||||
}
|
||||
}
|
||||
return r;
|
||||
|
Loading…
x
Reference in New Issue
Block a user