From c279d194dce8ca29c5b297b1024c3da51be1d95b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 27 Jun 2025 22:47:50 -0400 Subject: [PATCH] be paranoid about invalid molecule templates --- src/GRANULAR/fix_pour.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 2a50a6fdda..287c7eb52d 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -501,6 +501,8 @@ void FixPour::pre_exchange() imol = 0; while (rng > molfrac[imol]) imol++; natom = onemols[imol]->natoms; + if (natom <= 0) + error->all(FLERR, "Invalid number of atoms ({}) in molecule {}", natom, onemols[imol]->id); if (dimension == 3) { r[0] = random->uniform() - 0.5; r[1] = random->uniform() - 0.5;