sfx2/source/doc/objxtor.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit ee37679d446edb82e9a2f848ae35788074cf26c0 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri May 20 16:06:54 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 21 09:49:47 2022 +0200 cheaper to check for null return rather than catch exception Change-Id: Ifdbcbacc3d1340c77529ccacf4aaebf3dd250350 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134698 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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&)