From 6e898a3fee75761f33758df725bcf5679359e11e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 26 Mar 2012 13:53:55 +0100
Subject: [PATCH] Resolves: rhbz#806663 SlideshowImpl can outlive SdModule
 (somehow)

---
 sd/source/ui/slideshow/slideshowimpl.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 32d8e71..b44627e 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -595,7 +595,10 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation,
 
 SlideshowImpl::~SlideshowImpl()
 {
-    SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
+    SdModule *pModule = SD_MOD();
+    //rhbz#806663 SlideshowImpl can outlive SdModule
+    SdOptions* pOptions = pModule ?
+        pModule->GetSdOptions(DOCUMENT_TYPE_IMPRESS) : NULL;
     if( pOptions )
     {
         pOptions->SetPresentationPenColor(mnUserPaintColor);
-- 
1.7.10.4

