Skip to content

Commit aba03c3

Browse files
authored
Update code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php
1 parent cfa1c89 commit aba03c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
102102
$relationCount = $this->contentService->countRelations($versionInfo);
103103
$relationList = $this->contentService->loadRelationList($versionInfo, 0, $relationCount);
104104
foreach ($relationList as $relationListItem) {
105-
$name = $relationListItem->getRelation()->destinationContentInfo->name;
105+
$name = $relationListItem->hasRelation() ? $relationListItem->getRelation()->destinationContentInfo->name : '(Unauthorized)';
106106
$output->writeln("Relation to content '$name'");
107107
}
108108

0 commit comments

Comments
 (0)