fix potential null dereference if the open fails
if opening one testfile fails, don't keep trying.