avoid segfaults if a dump is created and followed by run pre no

This commit is contained in:
Axel Kohlmeyer
2023-06-20 13:31:16 -04:00
parent 6791651b62
commit fcc3c99e2b
7 changed files with 39 additions and 40 deletions

View File

@ -311,6 +311,8 @@ void DumpGrid::init_style()
void DumpGrid::write_header(bigint ndump)
{
if (!header_choice) error->all(FLERR, "Must not use 'run pre no' after creating a new dump");
if (multiproc) (this->*header_choice)(ndump);
else if (me == 0) (this->*header_choice)(ndump);
}