From 7fa5a9222f52c5adccb23b93d9104c0d337c3016 Mon Sep 17 00:00:00 2001
From: Michael Stahl <mstahl@redhat.com>
Date: Fri, 4 Jan 2013 22:27:22 +0100
Subject: [PATCH 10/14] rhbz#890080: crash in
 SwXTextDocument::getRendererCount

No idea how to reproduce it; pSwView is checked before use except here.
(possibly regression from 2f9f480b22f2fff59d9c48b4b46706c3d5223e66)

Change-Id: Ia7667e879a6944e084a45c06133efc1ac2d8b3c0
---
 sw/source/ui/uno/unotxdoc.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 8711d4e..8fb89db 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -2554,7 +2554,10 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
                 SwViewOption aOpt( *pViewShell->GetViewOptions() );
                 aOpt.setBrowseMode( false );
                 pViewShell->ApplyViewOptions( aOpt );
-                pSwView->RecheckBrowseMode();
+                if (pSwView)
+                {
+                    pSwView->RecheckBrowseMode();
+                }
             }
 
             // reformating the document for printing will show the changes in the view
-- 
1.7.10.4

