diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-04-24 16:20:58 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-04-24 16:21:41 +0100 |
commit | 5f91bce07962f4229242c466144962f9b3d58be6 (patch) | |
tree | 463774ba70a2c83cb31b6e668addf755c102aa5f /sd | |
parent | cb33ae88e000fb6c662ecf31a621a73223dfd081 (diff) |
sdremote - don't crash if we connect during load, before things are setup.
Change-Id: I1837ea58b9c8f74aca9afb78bafbab61af189842
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/remotecontrol/Communicator.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
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<presentation::XPresentationSupplier> xPS ( xFrame->getController()->getModel(), uno::UNO_QUERY_THROW); - uno::Reference<presentation::XPresentation2> xPresentation( - xPS->getPresentation(), uno::UNO_QUERY_THROW); - if ( xPresentation->isRunning() ) + uno::Reference< frame::XFrame > xFrame ( xFramesSupplier->getActiveFrame(), uno::UNO_QUERY ); + + uno::Reference<presentation::XPresentationSupplier> xPS; + if( xFrame.is() ) + xPS = uno::Reference<presentation::XPresentationSupplier>( xFrame->getController()->getModel(), uno::UNO_QUERY ); + uno::Reference<presentation::XPresentation2> xPresentation; + if( xPS.is() ) + xPresentation = uno::Reference<presentation::XPresentation2>( xPS->getPresentation(), uno::UNO_QUERY ); + if ( xPresentation.is() && xPresentation->isRunning() ) { presentationStarted( xPresentation->getController() ); } |