Get the current line only when we have a result

This commit is contained in:
Michael RICOIS 2012-06-01 14:36:43 +00:00
parent 2e6ef7b72f
commit 9d7c856846

View File

@ -317,11 +317,11 @@ class DashboardController extends Zend_Controller_Action
//Read prefs table to load actual config
$prefsM = new Application_Model_Prefs();
$userPrefs = $prefsM->find($user->username)->current();
$userPrefs = $prefsM->find($user->username);
$data = array('interface'=>array(),'filter'=>array());
if ($userPrefs) {
$data = json_decode($userPrefs->json, true);
$data = json_decode($userPrefs->current()->json, true);
} else {
$prefsM->insert(array('login'=>$user->username, 'json'=>json_encode($data)));
}