Skip to content

Commit 3852c54

Browse files
committed
Merge branch 'master' of github.com:denissonleal/laravel-mongodb into hotfix/multiconnection-queue
2 parents d5bb6f5 + 249355b commit 3852c54

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ composer require jenssegers/mongodb
4545
5.6.x | 3.4.x
4646
5.7.x | 3.4.x
4747
5.8.x | 3.5.x
48+
6.0.x | 3.6.x
4849

4950
And add the service provider in `config/app.php`:
5051

src/Jenssegers/Mongodb/Queue/Failed/MongoFailedJobProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public function find($id)
4646
{
4747
$job = $this->getTable()->find($id);
4848

49+
if (!$job) {
50+
return;
51+
}
52+
4953
$job['id'] = (string) $job['_id'];
5054

5155
return (object) $job;

tests/QueueTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,12 @@ public function testFailQueueJob(): void
6464

6565
$this->assertInstanceOf(MongoFailedJobProvider::class, $provider);
6666
}
67+
68+
public function testFindFailJobNull(): void
69+
{
70+
Config::set('queue.failed.database', 'mongodb');
71+
$provider = app('queue.failer');
72+
73+
$this->assertNull($provider->find(1));
74+
}
6775
}

0 commit comments

Comments
 (0)