diff --git a/lib/Service/SignFileService.php b/lib/Service/SignFileService.php index 4577ae15c2..eea81914a0 100644 --- a/lib/Service/SignFileService.php +++ b/lib/Service/SignFileService.php @@ -587,6 +587,9 @@ private function getPdfToSign(FileEntity $fileData, File $originalFile): File { $pdf->addFile($dest); $buffer = $pdf->stamp($background) ->toString(); + if (!is_string($buffer)) { + throw new LibresignException('Failed to merge the PDF with the footer. The PDF was not successfully created with the footer.'); + } } else { $buffer = $originalFile->getContent(); }