must check if file is readable before changes to internal data

This commit is contained in:
Axel Kohlmeyer 2021-04-24 07:12:45 -04:00
parent 6a9b441331
commit 6943a3da35
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 6 additions and 0 deletions

View File

@ -304,6 +304,12 @@ void ReadData::command(int narg, char **arg)
extra_dihedral_types || extra_improper_types))
error->all(FLERR,"Cannot use read_data extra with add flag");
// check if data file is available and readable
if (!utils::file_is_readable(arg[0]))
error->all(FLERR,fmt::format("Cannot open file {}: {}",
arg[0], utils::getsyserror()));
// first time system initialization
if (addflag == NONE) {