From f89a0f9fe35a0a5567981f7a7de0f796ce61d38f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 26 Aug 2020 11:50:20 -0400 Subject: [PATCH] must not try to delete computes if they have not been created and their ids not yet set --- src/reset_mol_ids.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/reset_mol_ids.cpp b/src/reset_mol_ids.cpp index 7ce027a657..a6cfb69185 100644 --- a/src/reset_mol_ids.cpp +++ b/src/reset_mol_ids.cpp @@ -41,14 +41,17 @@ ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) { compressflag = 1; singleflag = 0; offset = -1; + + idfrag.clear(); + idchunk.clear(); } /* ---------------------------------------------------------------------- */ ResetMolIDs::~ResetMolIDs() { - modify->delete_compute(idfrag); - if (compressflag) modify->delete_compute(idchunk); + if (!idfrag.empty()) modify->delete_compute(idfrag); + if (compressflag && !idchunk.empty()) modify->delete_compute(idchunk); } /* ----------------------------------------------------------------------