kingyiren / efflex

Automatically exported from code.google.com/p/efflex
0 stars 0 forks source link

Null Exception in ViewStackTweenEffect.removeChildren #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We are using the "Slide Effect" in manny viewstacks an got an error in the 
ViewStackTweenEffect.removeChildren method while closing some panels.

So is it posstibe to catch that error like that:

protected function removeChildren():void
{
    if ( display )
    {
        var numChildren:int  = display.numChildren;
        for( var i:int = numChildren - 1; i > -1; i-- )
        {
            display.removeChild( DisplayObject( 
                display.getChildAt( i ) ) );
        }
    }
}

Regards
Rainer

Original issue reported on code.google.com by langohr....@googlemail.com on 5 Oct 2009 at 1:17

GoogleCodeExporter commented 8 years ago
I was having the exact same issue and fixed the problem by checking that 
display is
not null as well.

Original comment by tommy.o...@gmail.com on 5 Oct 2009 at 1:31

GoogleCodeExporter commented 8 years ago
Yes same. In some cases if the view seems very dynamic (creationPolicy="none") 
or custom allocation deffered views the display on time tick could be null. 
Nevertheless it's more important that the applciation will not end up in NPE.

Original comment by frank.sz...@esentri.com on 13 Sep 2011 at 1:49