From: Alexander Smirnov Date: Thu, 8 Aug 2024 09:26:18 +0000 (+0300) Subject: Исправление. Мотивация может быть не найдена X-Git-Tag: 1.4~42^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=8d8425808bb1029c81d0af01d673900c60481213;p=erp24_rep%2Fyii-erp24%2F.git Исправление. Мотивация может быть не найдена --- diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 73f96610..0ada3d5e 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -390,9 +390,11 @@ class MotivationService } } - $motivation->save(); - if ($motivation->getErrors()) { - throw new \Exception(Json::encode($motivation->getErrors())); + if ($motivation) { + $motivation->save(); + if ($motivation->getErrors()) { + throw new \Exception(Json::encode($motivation->getErrors())); + } } }