// in the current directory
fDirectory = OpenDirectory();
- OpenNextFile();
+ if (!fDirectory) fIsValid = kFALSE;
+ if (!OpenNextFile()) fIsValid = kFALSE;
fHeader = new AliRawDataHeader;
fId[0] = fId[1] = 0;
// create an object to read digits from the given directory
fDirectory = OpenDirectory();
- OpenNextFile();
+ if (!fDirectory) fIsValid = kFALSE;
+ if (fEventIndex >= 0 && (!OpenNextFile())) fIsValid = kFALSE;
fHeader = new AliRawDataHeader;
fId[0] = fId[1] = 0;