From 5f91bce07962f4229242c466144962f9b3d58be6 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 24 Apr 2013 16:20:58 +0100 Subject: sdremote - don't crash if we connect during load, before things are setup. Change-Id: I1837ea58b9c8f74aca9afb78bafbab61af189842 --- sd/source/ui/remotecontrol/Communicator.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/remotecontrol/Communicator.cxx b/sd/source/ui/remotecontrol/Communicator.cxx index e5459fb39166..63ace55201f3 100644 --- a/sd/source/ui/remotecontrol/Communicator.cxx +++ b/sd/source/ui/remotecontrol/Communicator.cxx @@ -53,11 +53,15 @@ void Communicator::execute() Receiver aReceiver( pTransmitter ); try { uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create( ::comphelper::getProcessComponentContext() ); - uno::Reference< frame::XFrame > xFrame ( xFramesSupplier->getActiveFrame(), uno::UNO_QUERY_THROW ); - uno::Reference xPS ( xFrame->getController()->getModel(), uno::UNO_QUERY_THROW); - uno::Reference xPresentation( - xPS->getPresentation(), uno::UNO_QUERY_THROW); - if ( xPresentation->isRunning() ) + uno::Reference< frame::XFrame > xFrame ( xFramesSupplier->getActiveFrame(), uno::UNO_QUERY ); + + uno::Reference xPS; + if( xFrame.is() ) + xPS = uno::Reference( xFrame->getController()->getModel(), uno::UNO_QUERY ); + uno::Reference xPresentation; + if( xPS.is() ) + xPresentation = uno::Reference( xPS->getPresentation(), uno::UNO_QUERY ); + if ( xPresentation.is() && xPresentation->isRunning() ) { presentationStarted( xPresentation->getController() ); } -- cgit