don't crash if no RNTuple is found in a TFile

This commit is contained in:
silverweed 2024-08-20 17:20:39 +02:00
parent c3eebcec80
commit 56b84f958b

View file

@ -1092,7 +1092,7 @@ Root_File_Info get_root_file_info(const char *fname, const char *ntplName, bool
fileInfo.free_seek_seek = is_big_file ? offsetof(RTFHeader, fInfoLong.fSeekFree) : offsetof(RTFHeader, fInfoShort.fSeekFree);
fileInfo.free_nbytes_seek = is_big_file ? offsetof(RTFHeader, fInfoLong.fNbytesFree) : offsetof(RTFHeader, fInfoShort.fNbytesFree);
RTFKey freeHeader {
0, 100, RTFString{kNTupleClassName}, RTFString{ntplName}, RTFString{}, sizeof(RTFNTuple) + sizeof(std::uint64_t)
0, 100, RTFString{kNTupleClassName}, RTFString{ntplName ? ntplName : ""}, RTFString{}, sizeof(RTFNTuple) + sizeof(std::uint64_t)
};
fileInfo.free_header_nbytes = freeHeader.GetSize();
return fileInfo;
@ -1141,7 +1141,7 @@ RMicroFileReader::GetNTupleProper(const char *ntupleName)
RNTuple_File_Info fileInfo {};
#define FAIL(msg) \
fprintf(stderr, "%s", std::string(msg).c_str()); \
fprintf(stderr, "%s\n", std::string(msg).c_str()); \
fileInfo.failed = true; \
return fileInfo