mirror of https://github.com/lammps/lammps.git
make sure to always look up the region to avoid null pointer dereference
This commit is contained in:
parent
b9cc150f44
commit
eeff6aa06c
|
@ -906,7 +906,11 @@ void ComputeChunkAtom::assign_chunk_ids()
|
||||||
|
|
||||||
// update region if necessary
|
// update region if necessary
|
||||||
|
|
||||||
if (regionflag) region->prematch();
|
if (regionflag) {
|
||||||
|
region = domain->get_region_by_id(idregion);
|
||||||
|
if (!region) error->all(FLERR, "Region {} for compute chunk/atom does not exist", idregion);
|
||||||
|
region->prematch();
|
||||||
|
}
|
||||||
|
|
||||||
// exclude = 1 if atom is not assigned to a chunk
|
// exclude = 1 if atom is not assigned to a chunk
|
||||||
// exclude atoms not in group or not in optional region
|
// exclude atoms not in group or not in optional region
|
||||||
|
|
Loading…
Reference in New Issue