checking result of dynamic_cast for NULL pointer
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Feb 2011 07:17:47 +0000 (07:17 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Feb 2011 07:17:47 +0000 (07:17 +0000)
HLT/QA/AliHLTQADataMakerRec.cxx

index 2b8a17a..d444baf 100644 (file)
 //* provided "as is" without express or implied warranty.                  *
 //**************************************************************************
 
-/** @file   AliHLTQADataMakerRec.cxx
-    @author Matthias Richter
-    @date   2010-03-10
-    @brief  Steering class for the HLT offline QA
-*/
+/// @file   AliHLTQADataMakerRec.cxx
+/// @author Matthias Richter
+/// @date   2010-03-10
+/// @brief  Steering class for the HLT offline QA
+///
 #include "AliHLTQADataMakerRec.h"
 #include "AliHLTMisc.h"
 #include "AliHLTModuleAgent.h"
@@ -81,9 +81,10 @@ int AliHLTQADataMakerRec::LoadPlugins(const char* plugins)
     TIter next(tokens);
     TObject* obj=NULL;
     while ((obj=next())) {
-      if (obj->IsA()!=TObjString::Class()) continue;
+      TObjString* objstring=dynamic_cast<TObjString*>(obj);
+      if (!objstring) continue;
       AliHLTQADataMakerBase* plugin=AliHLTMisc::LoadInstance((AliHLTQADataMakerBase*)0,
-                                                            dynamic_cast<TObjString*>(obj)->GetString().Data());
+                                                            objstring->GetString().Data());
       if (!plugin) continue;
       AliInfo(Form("using HLT QA plugin %s", plugin->IsA()->GetName()));
       fPlugins.Add(plugin);