Skip to content

Commit d29abf5

Browse files
Plow74bharris74
andauthored
Updated VSAC loader to do a null check before calling string functions on the cell content. Some of the new value sets have null cells rather than empty strings. (#81)
Co-authored-by: bharris <[email protected]>
1 parent ccf15c7 commit d29abf5

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>org.sitenv.vocabulary</groupId>
55
<artifactId>codevalidator-api</artifactId>
6-
<version>1.0.24</version>
6+
<version>1.0.25</version>
77
<name>Code Validator API</name>
88
<url>http://www.sitenv.org</url>
99

src/main/java/org/sitenv/vocabularies/loader/valueset/VsacLoader.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,29 @@ public void load(List<File> filesToLoad, Connection connection) {
5252
rowlabel = row.getCell(0).getStringCellValue().trim();
5353
// Switching to use labels in the first column to look for meta info
5454
if (rowlabel.equalsIgnoreCase("VALUE SET NAME")) {
55-
valueSetName = row.getCell(1).getStringCellValue().toUpperCase().trim();
55+
if(row.getCell(1).getStringCellValue() != null){
56+
valueSetName = row.getCell(1).getStringCellValue().toUpperCase().trim();
57+
}
5658
}
5759
if (rowlabel.equalsIgnoreCase("OID")) {
58-
valueSetOid = row.getCell(1).getStringCellValue().toUpperCase().trim();
60+
if(row.getCell(1) != null) {
61+
valueSetOid = row.getCell(1).getStringCellValue().toUpperCase().trim();
62+
}
5963
}
6064
if (rowlabel.equalsIgnoreCase("TYPE")) {
61-
valueSetType = row.getCell(1).getStringCellValue().toUpperCase().trim();
65+
if(row.getCell(1) != null) {
66+
valueSetType = row.getCell(1).getStringCellValue().toUpperCase().trim();
67+
}
6268
}
6369
if (rowlabel.equalsIgnoreCase("DEFINITION VERSION")) {
64-
valueSetVersion = row.getCell(1).getStringCellValue().toUpperCase().trim();
70+
if(row.getCell(1) != null) {
71+
valueSetVersion = row.getCell(1).getStringCellValue().toUpperCase().trim();
72+
}
6573
}
6674
if (rowlabel.equalsIgnoreCase("STEWARD")) {
67-
valueSetSteward = row.getCell(1).getStringCellValue().toUpperCase().trim();
75+
if(row.getCell(1) != null) {
76+
valueSetSteward = row.getCell(1).getStringCellValue().toUpperCase().trim();
77+
}
6878
}
6979
}
7080

0 commit comments

Comments
 (0)