diff --git a/rmgpy/data/thermo.py b/rmgpy/data/thermo.py index c821468e5ae..4d1ab38fe04 100644 --- a/rmgpy/data/thermo.py +++ b/rmgpy/data/thermo.py @@ -1740,7 +1740,15 @@ def __addGroupThermoData(self, thermoData, database, molecule, atom): data = node.data comment = node.label + loop_count = 0 while isinstance(data, basestring): + loop_count += 1 + if loop_count > 100: + raise DatabaseError("Maximum iterations reached for __addGroupThermoData (100). Last node was {0} " + "pointing to group called {1} in database {2}".format(node.label, + data, + database.label)) + for entry in database.entries.itervalues(): if entry.label == data: data = entry.data