Skip to content

Commit

Permalink
Fixed NPE in issue #181
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosjepard authored and hmiguim committed Aug 3, 2023
1 parent 6293eef commit 310842e
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ private ReporterDetails validateCSIP80(final MetsValidatorState metsValidatorSta
} else {
int numberOfCSIPstructMaps = 0;
for (StructMapType struct : structMap) {
if (struct.getLABEL().equals("CSIP")) {
if (struct.getLABEL() != null && struct.getLABEL().equals("CSIP")) {
numberOfCSIPstructMaps++;
}
}
Expand Down Expand Up @@ -670,9 +670,8 @@ private ReporterDetails validateCSIP88(final MetsValidatorState metsValidatorSta
}
if (isMetadata) {
for (StructMapType struct : structMap) {
final DivType div = struct.getDiv();
if (div != null && div.getLABEL().equals("CSIP")) {
final List<DivType> divs = div.getDiv();
if (struct.getLABEL() != null && struct.getLABEL().equals("CSIP")) {
final List<DivType> divs = struct.getDiv().getDiv();
int counter = 0;
for (DivType d : divs) {
if (d.getLABEL().equals("Metadata")) {
Expand Down Expand Up @@ -1621,9 +1620,8 @@ private ReporterDetails validateCSIP106(final MetsValidatorState metsValidatorSt
final List<StructMapType> structMap = metsValidatorState.getMets().getStructMap();
if (structMap != null) {
for (StructMapType struct : structMap) {
final DivType firstDiv = struct.getDiv();
if (firstDiv != null && firstDiv.getLABEL().equals("CSIP")) {
final List<DivType> divs = firstDiv.getDiv();
if (struct.getLABEL() != null && struct.getLABEL().equals("CSIP")) {
final List<DivType> divs = struct.getDiv().getDiv();
for (DivType div : divs) {
final String id = div.getID();
if (id == null) {
Expand Down

0 comments on commit 310842e

Please sign in to comment.