Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity fixes #15

Merged
merged 4 commits into from
Aug 8, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tree/treeplayer/src/TTreeReaderArray.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ void ROOT::TTreeReaderArrayBase::CreateProxy()
}
} else if (branch->IsA() == TBranch::Class()) {
TLeaf *topLeaf = branch->GetLeaf(branch->GetName());
if (!topLeaf) {
Error("CreateProxy", "Failed to get the top leaf from the branch");
return;
}
Int_t size = 0;
TLeaf *sizeLeaf = topLeaf->GetLeafCounter(size);
if (!sizeLeaf) {
Expand Down Expand Up @@ -728,7 +732,7 @@ const char* ROOT::TTreeReaderArrayBase::GetBranchContentDataType(TBranch* branch
TLeaf *myLeaf = branch->GetLeaf(branch->GetName());
if (myLeaf){
TDictionary *myDataType = TDictionary::GetDictionary(myLeaf->GetTypeName());
if (myDataType->IsA() == TDataType::Class()){
if (myDataType && myDataType->IsA() == TDataType::Class()){
dict = TDataType::GetDataType((EDataType)((TDataType*)myDataType)->GetType());
contentTypeName = myLeaf->GetTypeName();
return 0;
Expand Down
4 changes: 2 additions & 2 deletions tree/treeplayer/src/TTreeReaderValue.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void ROOT::TTreeReaderValueBase::CreateProxy() {
nameStack.push_back(leafName.Strip(TString::kBoth, '.'));
}

if (branch->IsA() == TBranchElement::Class()){
if (branch && branch->IsA() == TBranchElement::Class()){
TBranchElement *myBranchElement = (TBranchElement*)branch;

TString traversingBranch = nameStack.back();
Expand Down Expand Up @@ -424,7 +424,7 @@ const char* ROOT::TTreeReaderValueBase::GetBranchDataType(TBranch* branch,
TLeaf *myLeaf = branch->GetLeaf(branch->GetName());
if (myLeaf){
TDictionary *myDataType = TDictionary::GetDictionary(myLeaf->GetTypeName());
if (myDataType->IsA() == TDataType::Class()){
if (myDataType && myDataType->IsA() == TDataType::Class()){
dict = TDataType::GetDataType((EDataType)((TDataType*)myDataType)->GetType());
return myLeaf->GetTypeName();
}
Expand Down