Author: bugman Date: Fri Jul 4 11:31:00 2014 New Revision: 24454 URL: http://svn.gna.org/viewcvs/relax?rev=24454&view=rev Log: Fix for the internal structural object MolContainer.last_residue() method. This can now operate when no structural information is present, returning 0 instead of resulting in an IndeError. Modified: trunk/lib/structure/internal/molecules.py Modified: trunk/lib/structure/internal/molecules.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/molecules.py?rev=24454&r1=24453&r2=24454&view=diff ============================================================================== --- trunk/lib/structure/internal/molecules.py (original) +++ trunk/lib/structure/internal/molecules.py Fri Jul 4 11:31:00 2014 @@ -487,6 +487,10 @@ @rtype: int """ + # No residues yet. + if not len(self.res_num): + return 0 + # Return the number. return self.res_num[-1]