Skip to content

Commit e2baac6

Browse files
validate connection name before resolve queue connection (#39751)
* validate connection name before resolve * Update QueueManager.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent dba65be commit e2baac6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Illuminate/Queue/QueueManager.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,17 @@ public function connection($name = null)
148148
*
149149
* @param string $name
150150
* @return \Illuminate\Contracts\Queue\Queue
151+
*
152+
* @throws \InvalidArgumentException
151153
*/
152154
protected function resolve($name)
153155
{
154156
$config = $this->getConfig($name);
155157

158+
if (is_null($config)) {
159+
throw new InvalidArgumentException("The [{$name}] queue connection has not been configured.");
160+
}
161+
156162
return $this->getConnector($config['driver'])
157163
->connect($config)
158164
->setConnectionName($name);

0 commit comments

Comments
 (0)