Fix for 1191 (detachEventHandler causing undefined index in CListIterator)

Modify CComponent to handle if an eventHandler has been removed while iterating over the event handlers.

fixes #1191 
As I run with error_reporting inclusive of notice, that makes a significant
difference for me as PHPUnit will fail on generated notices.
On Sep 15, 2014 10:02 PM, "Anatoly Rugalev" <notifications@github.com>
wrote:

> In framework/collections/CListIterator.php:
>
> > @@ -69,7 +69,8 @@ public function key()
> >  	 */
> >  	public function current()
> >  	{
> > -		return $this->_d[$this->_i];
> > +		if (isset($this->_d[$this->_i]))
> > +			return $this->_d[$this->_i];
>
> This modification is not necessary. If current array element is not set
> we'll get null and notice. In your code we will get null too. I can't see
> the difference
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/yiisoft/yii/pull/3538/files#r17583574>.
>