From 25548176bbd12318097a09300380ab9d44299cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 28 May 2023 12:19:57 +0200 Subject: [PATCH] fix the case when relation is set to null --- src/PersistentData/PersistentDataManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PersistentData/PersistentDataManager.php b/src/PersistentData/PersistentDataManager.php index 4bc99d3..f35add7 100644 --- a/src/PersistentData/PersistentDataManager.php +++ b/src/PersistentData/PersistentDataManager.php @@ -302,6 +302,8 @@ class PersistentDataManager implements IPersistentDataManager if ($relationModel !== null) { $model->$methodSet($relationModel->getId()); + } else { + $model->$methodSet(null); } } }