fix: Fixed an issue where adding an attribute to an empty temlate as a first element caused an error, fixes #1635

pull/1670/head
Iglocska 2016-11-15 06:17:36 +01:00
parent 6f2ba400e8
commit d0a65e96c2
1 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,9 @@ class TemplateElement extends AppModel {
'order' => array('id'),
'group' => array('id')
));
if (empty($result)) {
return 0;
}
return $result[0]['pos'];
}
}