Commit dfb5738d authored by Andrew Bauer's avatar Andrew Bauer
Browse files

Fixed issue when no time steps are available in the file.

The TimeStepRange member variable would have values of {0,-1}
if no time steps were in the input file which also caused
reading from out of bounds of an array.

Change-Id: I428b2b1826b66f30b2d9e859d6e810aee65d405d
parent 9d061878
......@@ -394,7 +394,7 @@ int vtkXMLReader
// this->ReadXMLInformation()
int numTimesteps = this->GetNumberOfTimeSteps();
this->TimeStepRange[0] = 0;
this->TimeStepRange[1] = numTimesteps-1;
this->TimeStepRange[1] = (numTimesteps > 0 ? numTimesteps-1 : 0);
if (numTimesteps != 0)
double* timeSteps = new double[numTimesteps];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment