diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-18 16:40:05 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-18 21:46:19 +0200 |
commit | 3cc367f426506e3165dda06feeb20e0a9b4c6194 (patch) | |
tree | 0bf7c3c9e28c8f3b5a62a50ac659506d26b12c2d | |
parent | f48045f718ce90a693789bd3dd8cd544c72a680c (diff) |
tdf#163486: PVS: check mpViewShell
V595 The 'mpViewShell' pointer was utilized before it was verified against nullptr. Check lines: 368, 380.
Change-Id: I5e8d53d3503ade1814d7436e89f0f407f1d9ccfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175164
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index e1bc2c4ec915..319ecafbb7c8 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -365,11 +365,14 @@ void SfxPrinterController::jobFinished( css::view::PrintableState nState ) case view::PrintableState_JOB_SPOOLED : case view::PrintableState_JOB_COMPLETED : { - SfxBindings& rBind = mpViewShell->GetViewFrame().GetBindings(); - rBind.Invalidate( SID_PRINTDOC ); - rBind.Invalidate( SID_PRINTDOCDIRECT ); - rBind.Invalidate( SID_SETUPPRINTER ); - bCopyJobSetup = ! m_bTempPrinter; + if (mpViewShell) + { + SfxBindings& rBind = mpViewShell->GetViewFrame().GetBindings(); + rBind.Invalidate( SID_PRINTDOC ); + rBind.Invalidate( SID_PRINTDOCDIRECT ); + rBind.Invalidate( SID_SETUPPRINTER ); + bCopyJobSetup = ! m_bTempPrinter; + } break; } |