sw/source/uibase/app/docsh.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit f0953b76bca6de273b809d7b587f2b30bca97262
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Mon Oct 28 16:01:15 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Tue Oct 29 08:41:26 2019 +0100

    tdf#128418 Fix crash in print preview
    
    Change-Id: I2a8c5511563ac3205722d63f22cde472a8aaddde
    Reviewed-on: https://gerrit.libreoffice.org/81610
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
    (cherry picked from commit d1b9267a646983ca9f301871056ae611d27be171)
    Reviewed-on: https://gerrit.libreoffice.org/81647
    Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 3ad2d9fa5b33..136f6f59a22a 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1062,7 +1062,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
         case FN_OUTLINE_TO_IMPRESS:
             {
                 SvtModuleOptions aMOpt;
-                if ( !aMOpt.IsImpress() || GetViewShell()->isExportLocked() )
+                if (!aMOpt.IsImpress() || (GetViewShell() && 
GetViewShell()->isExportLocked()))
                     rSet.DisableItem( nWhich );
             }
             [[fallthrough]];
@@ -1084,12 +1084,14 @@ void SwDocShell::GetState(SfxItemSet& rSet)
             break;
 
         case FN_NEW_GLOBAL_DOC:
-            if ( dynamic_cast< const SwGlobalDocShell *>( this ) !=  nullptr 
|| GetViewShell()->isExportLocked() )
+            if (dynamic_cast<const SwGlobalDocShell*>(this) != nullptr
+                || (GetViewShell() && GetViewShell()->isExportLocked()))
                 rSet.DisableItem( nWhich );
             break;
 
         case FN_NEW_HTML_DOC:
-            if( dynamic_cast< const SwWebDocShell *>( this ) !=  nullptr || 
GetViewShell()->isExportLocked()  )
+            if (dynamic_cast<const SwWebDocShell*>(this) != nullptr
+                || (GetViewShell() && GetViewShell()->isExportLocked()))
                 rSet.DisableItem( nWhich );
             break;
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to