Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-11028

PyROOT TGraph.GetX() crash on empty graph

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Clarified
    • 6.22/00, 6.22/02
    • None
    • PyROOT
    • None
    • ROOT 6.22.02 x86_64-centos7-gcc48-opt with OS Python 2.7.5 or 3.6.8

      OR

      LCG_98 (ROOT 6.22.00 and Python 2.7.16)

    Description

      Accessing the result of TGraph's GetX() when the graph was empty gives a null-pointer ReferenceError. Eg.

      import ROOT
       
      g = ROOT.TGraph()
      x = g.GetX()
      xl = list(x)
      print(xl) 
      
      

      gives an error on the list:

      ReferenceError: attempt to access a null-pointer

      This worked fine in ROOT 6.20, returning an empty list.

      It's easy to work round this by testing g.GetN() before calling GetX(), but this will break a lot of old code.

      Attachments

        Activity

          People

            etejedor Enric Tejedor Saavedra
            adye Tim Adye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: