Added check for when the custom field doesn't exist

- suppressed cron supervisor error
This commit is contained in:
Jonathan Labreuille
2016-01-22 11:02:48 +01:00
parent 6cac7f3652
commit 5a5a777b7d
2 changed files with 9 additions and 4 deletions

View File

@ -22,8 +22,9 @@ class Supervisor {
return $this->startDaemon(); return $this->startDaemon();
} }
if( if(
!$this->force_start && !$this->force_start
in_array($this->daemon['status'], array('stopped', 'stopping')) && isset($this->daemon['status'])
&& in_array($this->daemon['status'], array('stopped', 'stopping'))
) { ) {
return $this->daemon['status']; return $this->daemon['status'];
} }

View File

@ -13,8 +13,12 @@ class SubscriberCustomField extends Model {
} }
static function createOrUpdate($data = array()) { static function createOrUpdate($data = array()) {
$custom_field = CustomField::findOne($data['custom_field_id'])->asArray(); $custom_field = CustomField::findOne($data['custom_field_id']);
if($custom_field === false) return false; if($custom_field === false) {
return false;
} else {
$custom_field = $custom_field->asArray();
}
if($custom_field['type'] === 'date') { if($custom_field['type'] === 'date') {
if(is_array($data['value'])) { if(is_array($data['value'])) {