Don't serialize meta fields if they're null [MAILPOET-2073]

This commit is contained in:
wxa
2019-05-14 12:24:57 +03:00
committed by M. Shull
parent e15fd4661e
commit b99096d2df
4 changed files with 29 additions and 3 deletions

View File

@ -99,7 +99,7 @@ class ScheduledTask extends Model {
if (!$this->priority) {
$this->priority = self::PRIORITY_MEDIUM;
}
if (!Helpers::isJson($this->meta)) {
if (!is_null($this->meta) && !Helpers::isJson($this->meta)) {
$this->set(
'meta',
json_encode($this->meta)