Skip to content

Commit

Permalink
Fix the issue properly
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Oct 4, 2023
1 parent 8d062ac commit 10fb800
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
10 changes: 3 additions & 7 deletions webapp/src/Controller/Jury/ExecutableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use App\Service\EventLogService;
use App\Utils\Utils;
use Doctrine\ORM\EntityManagerInterface;
use InvalidArgumentException as PHPInvalidArgumentException;
use Symfony\Component\HttpKernel\Attribute\MapQueryParameter;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Form\Exception\InvalidArgumentException;
Expand Down Expand Up @@ -68,15 +69,10 @@ public function indexAction(Request $request): Response
$executables_table = [];
$configScripts = [];
foreach (['compare', 'run', 'full_debug'] as $config_script) {
/* Seems to fail
try {
$configScripts[] = (string)$this->config->get('default_' . $config_script);
} catch (InvalidArgumentException $e) {
// Ignore
}*/
// If not found this is an older database, as we only use this for visual changes ignore this error;
if ($this->config->checkExistance('default_' . $config_script)) {
$configScripts[] = (string)$this->config->get('default_' . $config_script);
} catch (PHPInvalidArgumentException $e) {
// If not found this is an older database, as we only use this for visual changes ignore this error;
}
}

Expand Down
10 changes: 0 additions & 10 deletions webapp/src/Service/ConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ public function get(string $name, bool $onlyIfPublic = false)
return $value;
}

public function checkExistance(string $name): bool
{
try {
$this->get($name);
return true;
} catch (InvalidArgumentException $e) {
return false;
}
}

/**
* Get all the configuration values, indexed by name.
*
Expand Down

0 comments on commit 10fb800

Please sign in to comment.