diff --git a/content/base/src/nsDocumentViewer.cpp b/content/base/src/nsDocumentViewer.cpp index d3ea19da281b..f41e8c5ea14e 100644 --- a/content/base/src/nsDocumentViewer.cpp +++ b/content/base/src/nsDocumentViewer.cpp @@ -1381,6 +1381,7 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent, if (!doesContainFrameSet && CanPrint==PR_TRUE) { #endif +if (!doesContainFrameSet) { NS_ENSURE_SUCCESS( aDContext->BeginDocument(), NS_ERROR_FAILURE ); aDContext->GetDeviceSurfaceDimensions(width, height); diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index d3ea19da281b..f41e8c5ea14e 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -1381,6 +1381,7 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent, if (!doesContainFrameSet && CanPrint==PR_TRUE) { #endif +if (!doesContainFrameSet) { NS_ENSURE_SUCCESS( aDContext->BeginDocument(), NS_ERROR_FAILURE ); aDContext->GetDeviceSurfaceDimensions(width, height); diff --git a/layout/base/src/nsDocumentViewer.cpp b/layout/base/src/nsDocumentViewer.cpp index d3ea19da281b..f41e8c5ea14e 100644 --- a/layout/base/src/nsDocumentViewer.cpp +++ b/layout/base/src/nsDocumentViewer.cpp @@ -1381,6 +1381,7 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent, if (!doesContainFrameSet && CanPrint==PR_TRUE) { #endif +if (!doesContainFrameSet) { NS_ENSURE_SUCCESS( aDContext->BeginDocument(), NS_ERROR_FAILURE ); aDContext->GetDeviceSurfaceDimensions(width, height);