зеркало из https://github.com/mozilla/gecko-dev.git
Bug 861106: Add null check for mDocument in SetTextZoom, SetFullZoom, and SetMinFontSize to prevent crash on tab close. [r=blassey]
This commit is contained in:
Родитель
7a26e938a0
Коммит
621376f7f2
|
@ -2793,6 +2793,11 @@ SetExtResourceFullZoom(nsIDocument* aDocument, void* aClosure)
|
|||
NS_IMETHODIMP
|
||||
nsDocumentViewer::SetTextZoom(float aTextZoom)
|
||||
{
|
||||
// If we don't have a document, then we need to bail.
|
||||
if (!mDocument) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (GetIsPrintPreview()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2830,6 +2835,11 @@ nsDocumentViewer::GetTextZoom(float* aTextZoom)
|
|||
NS_IMETHODIMP
|
||||
nsDocumentViewer::SetMinFontSize(int32_t aMinFontSize)
|
||||
{
|
||||
// If we don't have a document, then we need to bail.
|
||||
if (!mDocument) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (GetIsPrintPreview()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2895,6 +2905,11 @@ nsDocumentViewer::SetFullZoom(float aFullZoom)
|
|||
}
|
||||
#endif
|
||||
|
||||
// If we don't have a document, then we need to bail.
|
||||
if (!mDocument) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mPageZoom = aFullZoom;
|
||||
|
||||
struct ZoomInfo ZoomInfo = { aFullZoom };
|
||||
|
|
Загрузка…
Ссылка в новой задаче