I Have A Problem With Php 5.4.3

I have a finished project. Has worked well. In many cases, I get an error message: Trying to get property of non-object

eg:




$this->widget('zii.widgets.grid.CGridView', array(

    'dataProvider' => $true_rows,

    'columns' => array(array('name'=>'id', 'header'=>'Sorszám'), array('name'=>'0', 'header'=>'Amount'), array('name'=>'1', 'header'=>'Operator', 'value' => 'Operators::model()->findByPk($data[1])->name'), array('name'=>'2', 'header'=>'Currency'), array('name'=>'3', 'header'=>'Username', 'value' => 'UsersOperator::model()->findByAttributes(array("userid"=>$data[3]))->fn'), array('name'=>'4', 'header'=>'Nickname', 'value' => 'UsersOperator::model()->findByAttributes(array("userid"=>$data[3]))->nick')),    

));



What is the best solution?

Thanks for the reply!

If you are using something like


UsersOperator::model()->findByAttributes(array("userid"=>$data[3]))->nick

and there is no data to return, error massage will report Trying to get property of non-object. You should replace every of that with expressions for example:


$somedata ? display result : no result to display

Preblem fixed.

Did not have the array index :)