From 2153f6589375825196703ee29906bde58986904e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 5 Apr 2023 18:19:25 +1200 Subject: [PATCH] Update app/controllers/api/databases.php Co-authored-by: Christy Jacob --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4e82cad0dc..c0a8abd60c 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -102,7 +102,7 @@ function createAttribute(string $databaseId, string $collectionId, Document $att if ($type === Database::VAR_RELATIONSHIP) { $options['side'] = Database::RELATION_SIDE_PARENT; - $relatedCollection = $dbForProject->getDocument('database_' . $db->getInternalId(), $options['relatedCollection']); + $relatedCollection = $dbForProject->getDocument('database_' . $db->getInternalId(), $options['relatedCollection'] ?? ''); if ($relatedCollection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); }