]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
address coverity CID 19665
authoraadare <aadare@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Mar 2012 19:51:49 +0000 (19:51 +0000)
committeraadare <aadare@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Mar 2012 19:51:49 +0000 (19:51 +0000)
PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptCorrelations.cxx

index 24fa8e3c01ac746743db587a3e212d069120edc1..818743888be632799897b80abe77afe96e25d14a 100644 (file)
@@ -1037,6 +1037,8 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
     
   // count all events looked at here
   _eventCount++;
+
+  /*
   if (!_eventAccounting)
   {
     cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - !_eventAccounting" << endl;
@@ -1044,7 +1046,19 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
     return;
   }
   _eventAccounting->Fill(0);// count all calls to this function
-  
+  */
+
+  // A. Adare - Fix from above to avoid coverity complaint about null dereference 
+  if (_eventAccounting)
+    {
+      _eventAccounting->Fill(0);// count all calls to this function
+    }
+  else {
+    cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - !_eventAccounting" << endl;
+    cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - Skip this task" << endl;
+    return;
+  }
+    
   //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 1" << endl;
   
   //Get pointer to current event