From b9bab9d5e3bfe9e284ae0326b702b6c5e6b865e4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 27 Aug 2022 10:23:58 -0400 Subject: [PATCH] fix logic error introduced in PR #3408 --- src/comm.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/comm.cpp b/src/comm.cpp index 1679cc3c41..402cf8c7fb 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -318,10 +318,8 @@ void Comm::modify_params(int narg, char **arg) bordergroup = group->find(arg[iarg+1]); if (bordergroup < 0) error->all(FLERR, "Invalid comm_modify keyword: group {} not found", arg[iarg+1]); - if (atom->firstgroupname == nullptr) - error->all(FLERR, "Invalid comm_modify keyword: atom_modify first command must be used"); - if (strcmp(arg[iarg+1],atom->firstgroupname) != 0) - error->all(FLERR, "comm_modify group != atom_modify first group: {}", atom->firstgroupname); + if (bordergroup && ((atom->firstgroupname == nullptr) || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) + error->all(FLERR, "Comm_modify group != atom_modify first group: {}", atom->firstgroupname); iarg += 2; } else if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "comm_modify cutoff", error);