Skip to content

Commit 3d5d352

Browse files
committed
chore: prevent error when failure to apply json_encode
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent f69b183 commit 3d5d352

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Sign/JSignService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public function sign(JSignParam $params)
3030
exec($commandSign, $output);
3131

3232
$out = json_encode($output);
33+
if ($out === false) {
34+
throw new Exception('Error to sign PDF.');
35+
}
3336
$messageSuccess = "Finished: Signature succesfully created.";
3437
$isSigned = strpos($out, $messageSuccess) !== false;
3538

0 commit comments

Comments
 (0)