Skip to content

Commit a3872e1

Browse files
committed
MERGE: Merge branch '3.0' into master
2 parents c31ae13 + df14215 commit a3872e1

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

Classes/Command/NodeIndexCommandController.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NodeIndexCommandController extends CommandController
3030

3131
/**
3232
* @Flow\Inject
33-
* @var \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\NodeIndexer
33+
* @var \Neos\ContentRepository\Search\Indexer\NodeIndexerInterface
3434
*/
3535
protected $nodeIndexer;
3636

@@ -187,8 +187,12 @@ public function indexNodeCommand($identifier, $workspace = null)
187187
$indexInWorkspace($identifier, $workspace);
188188
}
189189
} else {
190-
$workspace = $this->workspaceRepository->findByIdentifier($workspace);
191-
$indexInWorkspace($identifier, $workspace);
190+
$workspaceInstance = $this->workspaceRepository->findByIdentifier($workspace);
191+
if ($workspaceInstance === null) {
192+
$this->outputLine('The given workspace (%s) does not exist.', [$workspace]);
193+
$this->quit(1);
194+
}
195+
$indexInWorkspace($identifier, $workspaceInstance);
192196
}
193197
}
194198

@@ -205,6 +209,11 @@ public function indexNodeCommand($identifier, $workspace = null)
205209
*/
206210
public function buildCommand($limit = null, $update = false, $workspace = null, $postfix = null)
207211
{
212+
if ($workspace !== null && $this->workspaceRepository->findByIdentifier($workspace) === null) {
213+
$this->logger->log('The given workspace (' . $workspace . ') does not exist.', LOG_ERR);
214+
$this->quit(1);
215+
}
216+
208217
if ($update === true) {
209218
$this->logger->log('!!! Update Mode (Development) active!', LOG_INFO);
210219
} else {

0 commit comments

Comments
 (0)