It looks like the crash in nsPrintJob::DoPrint is caused by `printData` being null, which means that `mPtr` must be null. But further up the stack in [nsPrintJob::SetupToPrintContent](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1557) we'd have returned if `mPrt != printData`, and after that point we dereference `printData` and don't crash, implying it's not null. I don't see how we can get to having null `mPrt` between there and the crash. For reference, here's the stack for one of the crashes: [PrintProgressDialogChild::RecvDialogOpened](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l2265) [nsPrintJob::Observe](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l2139) [nsPrintJob::InitPrintDocConstruction](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1624) [nsPrintJob::ResumePrintAfterResourcesLoaded](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1710) [nsPrintJob::ReconstructAndReflow](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1685) [nsPrintJob::PrintDocContent](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l2912) [nsPrintJob::DoPrint](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp#l37)
Bug 1652967 Comment 6 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
It looks like the crash in nsPrintJob::DoPrint is caused by `printData` being null, which means that `mPtr` must be null. But further up the stack in [nsPrintJob::SetupToPrintContent](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1557) we'd have returned if `mPrt != printData`, and after that point we dereference `printData` and don't crash, implying it's not null. I don't see how we can get to having null `mPrt` between there and the crash. For reference, here's the stack for one of the crashes: [nsPrintJob::DoPrint](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l2265) [nsPrintJob::PrintDocContent](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l2139) [nsPrintJob::ReconstructAndReflow](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1624) [nsPrintJob::ResumePrintAfterResourcesLoaded](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1710) [nsPrintJob::InitPrintDocConstruction](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l1685) [nsPrintJob::Observe](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/layout/printing/nsPrintJob.cpp#l2912) [PrintProgressDialogChild::RecvDialogOpened](https://hg.mozilla.org/mozilla-central/file/23131da780b50130e3430dbdc7b121bfe896bb3a/toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp#l37)