We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffdb4b8 commit ec5caf5Copy full SHA for ec5caf5
resources/js/screens/batches/preview.vue
@@ -43,6 +43,10 @@
43
44
this.$http.get(Horizon.basePath + '/api/batches/' + this.$route.params.batchId)
45
.then(response => {
46
+ if (!response.data.batch) {
47
+ this.$router.push({name: 'batches'})
48
+ }
49
+
50
this.batch = response.data.batch;
51
this.failedJobs = response.data.failedJobs;
52
src/Http/Controllers/BatchesController.php
@@ -59,8 +59,9 @@ public function show($id)
59
{
60
$batch = $this->batches->find($id);
61
62
- $failedJobs = app(JobRepository::class)
63
- ->getJobs($batch->failedJobIds);
+ $failedJobs = $batch
+ ? app(JobRepository::class)->getJobs($batch->failedJobIds)
64
+ : null;
65
66
return [
67
'batch' => $batch,
0 commit comments