mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 843543 - Add a null-check after ShowPrintDialog to avoid crashing. r=smaug
This commit is contained in:
parent
56ff9b26dd
commit
3cfffd0412
@ -616,13 +616,16 @@ nsPrintEngine::DoCommonPrint(bool aIsPrintPreview,
|
||||
// ShowPrintDialog triggers an event loop which means we can't assume
|
||||
// that the state of this->{anything} matches the state we've checked
|
||||
// above. Including that a given {thing} is non null.
|
||||
if (!mPrt) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// since we got the dialog and it worked then make sure we
|
||||
// are telling GFX we want to print silent
|
||||
printSilently = true;
|
||||
|
||||
if (mPrt && mPrt->mPrintSettings) {
|
||||
if (mPrt->mPrintSettings) {
|
||||
// The user might have changed shrink-to-fit in the print dialog, so update our copy of its state
|
||||
mPrt->mPrintSettings->GetShrinkToFit(&mPrt->mShrinkToFit);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user