Skip to content

Commit

Permalink
Fix missing test for json response validity
Browse files Browse the repository at this point in the history
  • Loading branch information
gabsource authored Feb 23, 2017
1 parent 389fbdb commit 61b2b80
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/PrintTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ public function send()
'ticket' => json_encode($ticket)
]);

if ($job) {
$job = json_decode($job);
if ($job && ($job = json_decode($job))) {

if ($job->success) {
return new PrintJob($job->job);
Expand All @@ -261,4 +260,4 @@ public function send()

throw new PrintTaskFailedException(sprintf('The print job submission has failed : %s', json_encode($job ?: 'Unknown error')));
}
}
}

0 comments on commit 61b2b80

Please sign in to comment.