Skip to content

Commit

Permalink
[hist] fix negative index when calling TList::At
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdymercury authored Oct 28, 2024
1 parent 67ea850 commit fb76b56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hist/hist/src/TH2Poly.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ void TH2Poly::SetBinError(Int_t bin, Double_t error)
const char *TH2Poly::GetBinName(Int_t bin) const
{
if (bin > GetNumberOfBins()) return "";
if (bin < 0) return "";
if (bin <= 0) return "";
return ((TH2PolyBin*) fBins->At(bin-1))->GetPolygon()->GetName();
}

Expand All @@ -912,7 +912,7 @@ const char *TH2Poly::GetBinName(Int_t bin) const
const char *TH2Poly::GetBinTitle(Int_t bin) const
{
if (bin > GetNumberOfBins()) return "";
if (bin < 0) return "";
if (bin <= 0) return "";
return ((TH2PolyBin*) fBins->At(bin-1))->GetPolygon()->GetTitle();
}

Expand Down

0 comments on commit fb76b56

Please sign in to comment.