Considering the case when there is no entry in the list for the trigger-class or...
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Mar 2013 11:16:18 +0000 (11:16 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Mar 2013 11:16:18 +0000 (11:16 +0000)
STEER/findAliasesForClass.C
STEER/findClassesForAlias.C

index d39e6a7..18b4258 100644 (file)
@@ -12,6 +12,10 @@ TObjArray* findAliasesForClass(THashList &list, const char* className)
 
     TObjArray* matchingTrAliases = new TObjArray(2);
     TNamed *n = dynamic_cast<TNamed*>(list.FindObject(className));
+    if(!n){
+       Printf("No entry for a trigger-class named \"%s\"",className);
+       return;
+    }
     TString aliasList = n->GetTitle();
     TObjArray* arrAliases = aliasList.Tokenize(',');
     Int_t nAliases = arrAliases->GetEntries();
index 919e643..145eb99 100644 (file)
@@ -29,5 +29,10 @@ TObjArray* findClassesForAlias(THashList &list, const char* aliasName)
        }
     }
 
+    if (matchingTrClasses->GetEntries() == 0){
+       Printf("No entries for the trigger alias \"%s\" were found. Returning null pointer.", aliasName);
+       return 0;
+    }
+
     return matchingTrClasses;
 }