avoid segfault

This commit is contained in:
Axel Kohlmeyer
2020-10-03 09:51:42 -04:00
parent 024c9238f9
commit af8f8d3c11

View File

@ -168,7 +168,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr)
}
catch(LAMMPSException &e) {
fmt::print(stderr, "LAMMPS Exception: {}", e.message);
*ptr = nullptr;
if (ptr) *ptr = nullptr;
}
#else
lmp = new LAMMPS(argc, argv, comm);