diff --git a/src/Command/Config/ExportViewCommand.php b/src/Command/Config/ExportViewCommand.php index 262b75b78..00322d486 100644 --- a/src/Command/Config/ExportViewCommand.php +++ b/src/Command/Config/ExportViewCommand.php @@ -153,6 +153,15 @@ protected function execute(InputInterface $input, OutputInterface $output) $viewTypeName = $viewTypeDefinition->getConfigPrefix() . '.' . $viewId; $viewNameConfig = $this->getConfiguration($viewTypeName); + if (empty($viewNameConfig)) { + $this->getIo()->error( + sprintf( + $this->trans('commands.config.export.view.messages.wrong-view'), + $viewId + ) + ); + return 0; + } $this->configExport[$viewTypeName] = ['data' => $viewNameConfig, 'optional' => $optionalConfig]; @@ -168,6 +177,6 @@ protected function execute(InputInterface $input, OutputInterface $output) } } - $this->exportConfigToModule($module, $this->trans('commands.views.export.messages.view-exported')); + $this->exportConfigToModule($module, $this->trans('commands.config.export.view.messages.view-exported')); } }