Skip to content

Commit ff7db11

Browse files
Protect against wrong file name.
1 parent 0c373d1 commit ff7db11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ramreader.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
void ramreader(const char *file = "ramexample.root")
1414
{
1515
auto f = TFile::Open(file);
16+
if (!f) {
17+
printf("ramreader: failed to open file %s\n", file);
18+
return;
19+
}
1620
auto t = RAMRecord::GetTree(f);
1721

1822
RAMRecord *r = 0;

0 commit comments

Comments
 (0)