зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1763679 - Null-check in PrintTargetPDF, rather than relying on the caller to do so. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D143245
This commit is contained in:
Родитель
51437e8fd3
Коммит
ff12c3d22c
|
@ -49,6 +49,10 @@ PrintTargetPDF::~PrintTargetPDF() {
|
|||
/* static */
|
||||
already_AddRefed<PrintTargetPDF> PrintTargetPDF::CreateOrNull(
|
||||
nsIOutputStream* aStream, const IntSize& aSizeInPoints) {
|
||||
if (NS_WARN_IF(!aStream)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
cairo_surface_t* surface = cairo_pdf_surface_create_for_stream(
|
||||
write_func, (void*)aStream, aSizeInPoints.width, aSizeInPoints.height);
|
||||
if (cairo_surface_status(surface)) {
|
||||
|
|
|
@ -110,10 +110,6 @@ already_AddRefed<PrintTarget> nsDeviceContextSpecGTK::MakePrintTarget() {
|
|||
return stream;
|
||||
}();
|
||||
|
||||
if (!stream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return PrintTargetPDF::CreateOrNull(stream, IntSize::Ceil(width, height));
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче