]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Исправление. Мотивация может быть не найдена
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 8 Aug 2024 09:26:18 +0000 (12:26 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 8 Aug 2024 09:26:18 +0000 (12:26 +0300)
erp24/services/MotivationService.php

index 73f9661021ff664121df76d799a75c4436a8bc52..0ada3d5e52587793fd22291d954eac4179dee154 100644 (file)
@@ -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()));
+            }
         }
     }