summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-14 13:25:44 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-14 13:40:59 +0200
commitc32333aed6286b6f42f2a491759a559732d0b8b2 (patch)
treecb7d8493c43dce6c01d74333191827a3f6b2e9a3 /sfx2
parent59197f1892777a5629bad210b9ed1071ed550570 (diff)
sfx2: tolerate frames without controller in GetSidebarControllerForFrame
Unfortnately happens in CppunitTest_writerperfect_draw for Draw docs. Change-Id: I1317d30d71fa5975564d1060cbf8958f63b67f40
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 38310235c7e1..a87b65352eed 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -149,8 +149,14 @@ SidebarController::~SidebarController()
SidebarController* SidebarController::GetSidebarControllerForFrame (
const css::uno::Reference<css::frame::XFrame>& rxFrame)
{
+ uno::Reference<frame::XController> const xController(rxFrame->getController());
+ if (!xController.is()) // this may happen during dispose of Draw controller but perhaps it's a bug
+ {
+ SAL_WARN("sfx2.sidebar", "GetSidebarControllerForFrame: frame has no XController");
+ return nullptr;
+ }
uno::Reference<ui::XContextChangeEventListener> const xListener(
- framework::GetFirstListenerWith(rxFrame->getController(),
+ framework::GetFirstListenerWith(xController,
[] (uno::Reference<uno::XInterface> const& xRef)
{ return nullptr != dynamic_cast<SidebarController*>(xRef.get()); }
));