Fixed problem when nameToID returns no results.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@282 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -95,8 +95,11 @@ class AppModel extends Model {
|
||||
'conditions' => compact('name'),
|
||||
));
|
||||
$this->cacheQueries = false;
|
||||
$item = current($item);
|
||||
return $item['id'];
|
||||
if ($item) {
|
||||
$item = current($item);
|
||||
return $item['id'];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user