← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

 

 	BodyContainer::iterator biEnd = bodies->end();
 	for(  ; bi!=biEnd ; ++bi )
 	{
+		if (!*bi)  continue;
 		shared_ptr<Body> b = *bi;

I it not possible that iterator will return empty pointer. If it
does, then it's a bug in the iterator.

It doesn't matter if bodies are not numbered consecutively, iterator
does not care about 'id'. It is just going through the container of
bodies. You can safely remove this line and look for bug somewhere
else.

-- 
Janek Kozicki                               http://janek.kozicki.pl/  |


Follow ups

References