summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/source/core/sdpage2.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 0b9a552d75c2..2ab843a175db 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -208,9 +208,10 @@ void SdPage::SetPresentationLayout(const OUString& rLayoutName,
if (pSheet != pOldSheet)
{
- pObj->EndListening(*pOldSheet);
+ if (pOldSheet)
+ pObj->EndListening(*pOldSheet);
- if (!pObj->IsListening(*pSheet))
+ if (pSheet && !pObj->IsListening(*pSheet))
pObj->StartListening(*pSheet);
}