Update app/controllers/api/databases.php

Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
This commit is contained in:
Jake Barnby
2023-04-05 18:19:25 +12:00
committed by GitHub
co-authored by Christy Jacob
parent 72f203b365
commit 2153f65893
+1 -1
View File
@@ -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);
}