From 0b515ea9249d475532a1d6766aa62f23fffdd694 Mon Sep 17 00:00:00 2001 From: mohamed-foly Date: Wed, 24 Nov 2021 16:07:29 +0200 Subject: [PATCH 1/2] validate connection name before resolve --- src/Illuminate/Queue/QueueManager.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Illuminate/Queue/QueueManager.php b/src/Illuminate/Queue/QueueManager.php index 624836637c02..604248c8a320 100755 --- a/src/Illuminate/Queue/QueueManager.php +++ b/src/Illuminate/Queue/QueueManager.php @@ -148,10 +148,15 @@ public function connection($name = null) * * @param string $name * @return \Illuminate\Contracts\Queue\Queue + * + * @throws \InvalidArgumentException */ protected function resolve($name) { $config = $this->getConfig($name); + if ($config === null){ + throw new InvalidArgumentException("No config for connection [$name]."); + } return $this->getConnector($config['driver']) ->connect($config) From a6c0f445a88cd509163bc2cb434562c23e906a0f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 24 Nov 2021 08:55:29 -0600 Subject: [PATCH 2/2] Update QueueManager.php --- src/Illuminate/Queue/QueueManager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Queue/QueueManager.php b/src/Illuminate/Queue/QueueManager.php index 604248c8a320..162b951d14a6 100755 --- a/src/Illuminate/Queue/QueueManager.php +++ b/src/Illuminate/Queue/QueueManager.php @@ -154,8 +154,9 @@ public function connection($name = null) protected function resolve($name) { $config = $this->getConfig($name); - if ($config === null){ - throw new InvalidArgumentException("No config for connection [$name]."); + + if (is_null($config)) { + throw new InvalidArgumentException("The [{$name}] queue connection has not been configured."); } return $this->getConnector($config['driver'])