1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Improve error when downloading deleted invoice

This commit is contained in:
Hillel Coren 2017-07-24 16:53:35 +03:00
parent f573e09349
commit 9e437e8a12
2 changed files with 10 additions and 1 deletions

View File

@ -584,6 +584,10 @@ class ClientPortalController extends BaseController
private function returnError($error = false)
{
if (request()->phantomjs) {
abort(404);
}
return response()->view('error', [
'error' => $error ?: trans('texts.invoice_not_found'),
'hideHeader' => true,

View File

@ -423,7 +423,12 @@ class InvoiceApiController extends BaseAPIController
public function download(InvoiceRequest $request)
{
$invoice = $request->entity();
$pdfString = $invoice->getPDFString();
return $this->fileReponse($invoice->getFileName(), $invoice->getPDFString());
if ($pdfString) {
return $this->fileReponse($invoice->getFileName(), $pdfString);
} else {
abort(404);
}
}
}