make sure to always look up the region to avoid null pointer dereference

This commit is contained in:
Axel Kohlmeyer 2022-10-01 13:34:55 -04:00
parent b9cc150f44
commit eeff6aa06c
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 5 additions and 1 deletions

View File

@ -906,7 +906,11 @@ void ComputeChunkAtom::assign_chunk_ids()
// 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 atoms not in group or not in optional region