TChain Merge badread=0

Hello Everybody,
I have a question concerning the Merge function of a TChain object. I try to merge a lot of files produced some time ago into one file. In general it works fine. But from time to time I have some corrupted files which cause a crash of the merging process. I have so many of these MonteCarlo events that I don’t care about this particular file if I were able to check automatically if the error with the output seen below will happen. So there is maybe some kind of check available to find out if the file is corrupted. So far I could not find a way.

Thanks for the help
Philip vD

SysError in TFile::Seek: cannot seek to position 1038277901323902568 in file …/results/helium_southpole_-1/cosmic_ray_helium_54_-1_complete.root, retpos=-1 (Invalid argument)
Error in TFile::ReadBuffer: error reading all requested bytes from file …/results/helium_southpole_-1/cosmic_ray_helium_54_-1_complete.root, got 77903 of 8947832
Error in TBranchElement::GetBasket: File: …/results/helium_southpole_-1/cosmic_ray_helium_54_-1_complete.root at byte:0, branch:PVD_secondary_Energy, entry:188, badread=0

Could you specify your version of ROOT? and in case of an old version, try with version >=5.18

Rene