I have a simple function that returns the name of a category. I tested it as shown below with an exit statement after the echo test.
public function getCategory($id = null)
It echos back the correct answer. I then took out the exit, and Yii errors out saying that I am "Trying to get property of non-object" and pointing to the echo line which previously just worked perfectly. No matter where I try to get the $category->category result, unless I exit Yii immediately it errors. What am I doing wrong?