diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx
index eddec0b2136dfda4631ccd5456573e71a7a168eb..72d8cbe0108c8a38e33ea1bf7a0f326f2a124b51 100755
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetTagCalibration/CalibrationBroker.h"
@@ -173,8 +173,10 @@ namespace Analysis {
         if((*hI).second.first) {
 	  if(((*hI).second.first)->InheritsFrom("TH1")){
 	    if( msgLvl(MSG::VERBOSE) ){
-	      msg(MSG::VERBOSE)<< " entries: " 
-			       << dynamic_cast<TH1*>(((*hI).second).first)->GetEntries();
+              if (auto th1 = dynamic_cast<TH1*>(((*hI).second).first)) {
+                msg(MSG::VERBOSE)<< " entries: " 
+                                 << th1->GetEntries();
+              }
 	    }  
 	  } 
         } else {