tdf#119042: Also check if SfxViewFrame::Current() is nullptr

Change-Id: I5ac43ff626bfb4e2e754cacead5bf87115f3ce4b
Reviewed-on: https://gerrit.libreoffice.org/58447
Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Tested-by: Jenkins
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index d43a046..14fd822 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1231,8 +1231,9 @@ SwPagePreview::~SwPagePreview()
    delete pVShell;

    m_pViewWin.disposeAndClear();
    if (auto& pBar = SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar())
        pBar->ControlListener(false);
    if (SfxViewFrame* pCurrent = SfxViewFrame::Current())
        if (auto& pBar = pCurrent->GetWindow().GetSystemWindow()->GetNotebookBar())
            pBar->ControlListener(false);
    m_pScrollFill.disposeAndClear();
    m_pHScrollbar.disposeAndClear();
    m_pVScrollbar.disposeAndClear();