mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-29 22:30:13 +02:00
fix: dont fail for non-existing enabled bridge (#3589)
* fix: dont fail for non-existing enabled bridge * yup
This commit is contained in:
parent
10f7b6f4f6
commit
ed97ce8646
4 changed files with 25 additions and 12 deletions
|
@ -33,9 +33,15 @@ class DisplayAction implements ActionInterface
|
|||
private function createResponse(array $request)
|
||||
{
|
||||
$bridgeFactory = new BridgeFactory();
|
||||
$bridgeClassName = $bridgeFactory->createBridgeClassName($request['bridge'] ?? '');
|
||||
$formatFactory = new FormatFactory();
|
||||
|
||||
$bridgeName = $request['bridge'] ?? null;
|
||||
$format = $request['format'] ?? null;
|
||||
|
||||
$bridgeClassName = $bridgeFactory->createBridgeClassName($bridgeName);
|
||||
if (!$bridgeClassName) {
|
||||
throw new \Exception(sprintf('Bridge not found: %s', $bridgeName));
|
||||
}
|
||||
if (!$format) {
|
||||
throw new \Exception('You must specify a format!');
|
||||
}
|
||||
|
@ -43,7 +49,6 @@ class DisplayAction implements ActionInterface
|
|||
throw new \Exception('This bridge is not whitelisted');
|
||||
}
|
||||
|
||||
$formatFactory = new FormatFactory();
|
||||
$format = $formatFactory->create($format);
|
||||
|
||||
$bridge = $bridgeFactory->create($bridgeClassName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue