Skip to content

Commit 7e3db0c

Browse files
committed
fix nullpointerexception on calculate average values of collection report
1 parent 4db0100 commit 7e3db0c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

curation-module-core/src/main/java/eu/clarin/cmdi/curation/report/CollectionReport.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,11 @@ public void calculateAverageValues() {
363363
Accumulators.max("max_resp", "$duration")
364364
)));
365365
Document result = aggregate.first();
366-
urlReport.avgRespTime = result.getDouble("avg_resp");
367-
urlReport.maxRespTime = result.getLong("max_resp");
366+
367+
if(result!=null){
368+
urlReport.avgRespTime = result.getDouble("avg_resp");
369+
urlReport.maxRespTime = result.getLong("max_resp");
370+
}
368371

369372
}
370373

@@ -463,8 +466,6 @@ public static class URLValidationReport {
463466
public int totNumOfUniqueLinks;
464467
public int totNumOfCheckedLinks;
465468
public Double avgNumOfUniqueLinks = 0.0;
466-
// public int totNumOfResProxiesLinks;
467-
// public Double avgNumOfResProxiesLinks = 0.0;
468469
public int totNumOfBrokenLinks;
469470
public Double avgNumOfBrokenLinks = 0.0;
470471
public Double ratioOfValidLinks = 0.0;

0 commit comments

Comments
 (0)