mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Catch TypeError when rendering 1d barcode
This commit is contained in:
parent
41eccaeae0
commit
bed1055c4e
|
@ -7,6 +7,7 @@ use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use TCPDF;
|
use TCPDF;
|
||||||
use TCPDF_STATIC;
|
use TCPDF_STATIC;
|
||||||
|
use TypeError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model for Labels.
|
* Model for Labels.
|
||||||
|
@ -372,7 +373,7 @@ abstract class Label
|
||||||
if (empty($value)) return;
|
if (empty($value)) return;
|
||||||
try {
|
try {
|
||||||
$pdf->write1DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]);
|
$pdf->write1DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception|TypeError $e) {
|
||||||
\Log::error('The 1D barcode ' . $value . ' is not compliant with the barcode type '. $type);
|
\Log::error('The 1D barcode ' . $value . ' is not compliant with the barcode type '. $type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue