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); }