From 2a0894f3d1df1015f3a7d2f5acc04cccbb4b2096 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 16 Jan 2025 13:29:08 +0530 Subject: [PATCH] fix: incorrect project payloads --- src/Appwrite/Event/Event.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 4029502ea7..4efc138ec6 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -147,11 +147,13 @@ class Event */ public function trimFields(): self { - $this->project = new Document([ - '$id' => $this->project->getId(), - '$internalId' => $this->project->getInternalId(), - 'database' => $this->project->getAttribute('database') - ]); + if ($this->project) { + $this->project = new Document([ + '$id' => $this->project->getId(), + '$internalId' => $this->project->getInternalId(), + 'database' => $this->project->getAttribute('database') + ]); + } return $this; }