diff --git a/src/potential_file_reader.cpp b/src/potential_file_reader.cpp index aff1ce2f01..c6c58ede36 100644 --- a/src/potential_file_reader.cpp +++ b/src/potential_file_reader.cpp @@ -42,6 +42,9 @@ PotentialFileReader::PotentialFileReader(LAMMPS *lmp, try { reader = open_potential(filename); + if(!reader) { + error->one(FLERR, fmt::format("cannot open {} potential file {}", potential_name, filename).c_str()); + } } catch (FileReaderException & e) { error->one(FLERR, e.what()); }