diff --git a/src/tcutility/molecule.py b/src/tcutility/molecule.py index 4095f28d..0c073cb3 100644 --- a/src/tcutility/molecule.py +++ b/src/tcutility/molecule.py @@ -39,7 +39,7 @@ def save(mol: plams.Molecule, path: str, comment: str = None): """Save a molecule in a custom xyz file format. Molecule and atom flags can be provided as the "flags" parameter of the object (mol.flags and atom.flags). """ - comment = comment or mol.comment + comment = comment or mol.comment if hasattr(mol, 'comment') else '' with open(path, "w+") as f: f.write(f"{len(mol.atoms)}\n{comment}\n") for atom in mol.atoms: