From 8d8425808bb1029c81d0af01d673900c60481213 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Thu, 8 Aug 2024 12:26:18 +0300 Subject: [PATCH] =?utf8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5.=20=D0=9C=D0=BE=D1=82=D0=B8=D0=B2=D0=B0=D1=86?= =?utf8?q?=D0=B8=D1=8F=20=D0=BC=D0=BE=D0=B6=D0=B5=D1=82=20=D0=B1=D1=8B?= =?utf8?q?=D1=82=D1=8C=20=D0=BD=D0=B5=20=D0=BD=D0=B0=D0=B9=D0=B4=D0=B5?= =?utf8?q?=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MotivationService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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())); + } } } -- 2.39.5