Commit 61680c7c authored by Patrick Ropp's avatar Patrick Ropp

Merge branch '48-error-possibly-caused-by-empty-ligand-file' into 'master'

Prevented crashing when loading empty pdbqt files

Closes #48

See merge request !19
parents 47b69887 7b109ddb
...@@ -253,17 +253,20 @@ class FileIO(): ...@@ -253,17 +253,20 @@ class FileIO():
# Now merge the last two columns. # Now merge the last two columns.
atom_inf = self.__parent_molecule.get_atom_information() atom_inf = self.__parent_molecule.get_atom_information()
atom_types = numpy.defchararray_add( # In some instances, the atom information value can be None
atom_inf["element"], atom_inf["charge"] if atom_inf is not None:
)
atom_inf["element"] = numpy.defchararray_strip(atom_types) atom_types = numpy.defchararray_add(
atom_inf["element"], atom_inf["charge"]
)
atom_inf["charge"] = "\n" atom_inf["element"] = numpy.defchararray_strip(atom_types)
atom_inf["element_padded"] = numpy.defchararray_rjust( atom_inf["charge"] = "\n"
atom_inf["element"], 2
) atom_inf["element_padded"] = numpy.defchararray_rjust(
atom_inf["element"], 2
)
self.__parent_molecule.set_atom_information(atom_inf) self.__parent_molecule.set_atom_information(atom_inf)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment