Skip to content

Commit

Permalink
statistics: Fix NPE
Browse files Browse the repository at this point in the history
Fixes

java.lang.NullPointerException: null
        at diskCacheV111.services.PoolStatisticsV0.printTotal(PoolStatisticsV0.java:1219) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtml(PoolStatisticsV0.java:1151) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtmlFiles(PoolStatisticsV0.java:1056) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.access$1100(PoolStatisticsV0.java:119) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0$HourlyRunner.run(PoolStatisticsV0.java:441) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at dmg.cells.nucleus.CellNucleus$3.run(CellNucleus.java:707) [cells-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]

If there is no data, we cannot print a total.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6963/
(cherry picked from commit 0194173)
  • Loading branch information
gbehrmann committed May 5, 2014
1 parent 1935879 commit 8e417ea
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -1139,7 +1139,9 @@ private void prepareDailyHtmlFiles( Calendar calendar ){
allPw.close() ;
}

printTotal( new File( pathBase , "total.raw" ) , total , date ) ;
if (total != null) {
printTotal(new File(pathBase, "total.raw"), total, date);
}

BaseStatisticsHtml allClassesHtml = new BaseStatisticsHtml() ;
allClassesHtml.setSorted(true);
Expand Down

0 comments on commit 8e417ea

Please sign in to comment.