From f871fb0c6dbd46dcc7ebb296bfd6297a5178b440 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Fri, 11 May 2018 18:06:28 +0100 Subject: [PATCH] check file is opened correctly in the Lime reader --- lib/parallelIO/IldgIO.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/parallelIO/IldgIO.h b/lib/parallelIO/IldgIO.h index 90c05546..33af6c3d 100644 --- a/lib/parallelIO/IldgIO.h +++ b/lib/parallelIO/IldgIO.h @@ -182,6 +182,11 @@ class GridLimeReader : public BinaryIO { { filename= _filename; File = fopen(filename.c_str(), "r"); + if (File == nullptr) + { + std::cerr << "cannot open file '" << filename << "'" << std::endl; + abort(); + } LimeR = limeCreateReader(File); } /////////////////////////////////////////////