diff options
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index fb6cca399cec..c83a446a8b22 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -1032,8 +1032,10 @@ SfxObjectShell* SfxObjectShell::GetShellFromComponent(const Reference<uno::XInte { try { - Reference<lang::XUnoTunnel> xTunnel(xComp, UNO_QUERY_THROW); - Sequence <sal_Int8> aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() ); + Reference<lang::XUnoTunnel> xTunnel(xComp, UNO_QUERY); + if (!xTunnel) + return nullptr; + static const Sequence <sal_Int8> aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() ); return comphelper::getSomething_cast<SfxObjectShell>(xTunnel->getSomething(aSeq)); } catch (const Exception&) |