From 7f76e04b8db090d551329a6e54e74aa29a6aee03 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Wed, 28 Feb 2024 15:23:48 -0800 Subject: [PATCH] check for atomtype presence before removal --- rmgpy/molecule/group.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rmgpy/molecule/group.py b/rmgpy/molecule/group.py index b3ebdd5e32..f4b0649c0d 100644 --- a/rmgpy/molecule/group.py +++ b/rmgpy/molecule/group.py @@ -1419,10 +1419,11 @@ def get_extensions(self, r=None, r_bonds=None, r_un=None, basename='', atm_ind=N r = [ATOMTYPES[x] for x in r] R = r[:] - R.remove(ATOMTYPES['X']) + if ATOMTYPES['X'] in R: + R.remove(ATOMTYPES['X']) RnH = R[:] - - RnH.remove(ATOMTYPES['H']) + if ATOMTYPES['H'] in RnH: + RnH.remove(ATOMTYPES['H']) atoms = self.atoms if atm_ind is None: