From d899e8d3df99684a893c1facbd34902bbca6388c Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 21 Mar 2022 12:01:27 +0200 Subject: [PATCH] fix --- application/Espo/Repositories/Preferences.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/Espo/Repositories/Preferences.php b/application/Espo/Repositories/Preferences.php index 9fc9041019..24c47ebce8 100644 --- a/application/Espo/Repositories/Preferences.php +++ b/application/Espo/Repositories/Preferences.php @@ -38,6 +38,7 @@ use Espo\Core\Utils\Json; use Espo\Entities\Preferences as PreferencesEntity; use Espo\Entities\User; +use RuntimeException; use stdClass; use Espo\Core\Di; @@ -238,7 +239,7 @@ class Preferences implements Repository, public function save(Entity $entity, array $options = []): void { if (!$entity->hasId()) { - return; + throw new RuntimeException(); } $this->data[$entity->getId()] = $entity->toArray(); @@ -294,7 +295,7 @@ class Preferences implements Repository, public function remove(Entity $entity, array $options = []): void { if (!$entity->hasId()) { - return; + throw new RuntimeException(); } $this->deleteFromDb($entity->getId());