Skip to content

Commit

Permalink
[ConfigController] Fixed an exception on config load
Browse files Browse the repository at this point in the history
  • Loading branch information
Eldar Gazaliev committed Apr 13, 2022
1 parent 6220835 commit ff76b25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
composer.lock
vendor

/.php_cs.cache
.idea

6 changes: 5 additions & 1 deletion src/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,15 @@ public function getAction(Request $request): JsonResponse
$name = $request->get('name');

$configuration = Dao::getByName($name);

if (empty($configuration)) {
throw new Exception('Name does not exist.');
}

if ($configuration && isset($configuration->configuration->general->executor)) {
if (
isset($configuration->configuration->general->executor) &&
class_exists($configuration->configuration->general->executor)
) {
/** @var $className IExecutor */
$className = $configuration->configuration->general->executor;
$cli = $className::getCli($name, null);
Expand Down

0 comments on commit ff76b25

Please sign in to comment.