diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-06-06 16:20:45 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-06-08 12:07:00 +0200 |
commit | 83aee9f7a56403a5222a605e4063c25a4c38ecb9 (patch) | |
tree | 516de17b899f941b2f65e6c17dadedefdc06d9d8 /sfx2 | |
parent | aa561b01a7fa8cbe1adaa690014c466765eff6c4 (diff) |
sfx2: SfxMedium::Transfer_Impl() ignore exceptions when getting props
Somehow (bisected to commit bc48f2656c9a7bc1f41541bff66ec2c4496466a4)
this throws an exception now when getting "Title" when storing a
new file to a WebDAV server (the server naturally replies with 404).
There is already a fallback to get the filename, so just ignore
exceptions here so the transfer can succeed.
Change-Id: Ic609f2a4f5a67670b2d8eeb74680730053a7d3a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152678
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit a1393ab3766c2f010115931a6c4edc01240c5c6e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152654
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index c17b7827145d..8690da98913e 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2427,11 +2427,18 @@ void SfxMedium::Transfer_Impl() // LongName wasn't defined anywhere, only used here... get the Title instead // as it's less probably empty OUString aFileName; - Any aAny = aDestContent.getPropertyValue("Title"); - aAny >>= aFileName; - aAny = aDestContent.getPropertyValue( "ObjectId" ); OUString sObjectId; - aAny >>= sObjectId; + try + { + Any aAny = aDestContent.getPropertyValue("Title"); + aAny >>= aFileName; + aAny = aDestContent.getPropertyValue("ObjectId"); + aAny >>= sObjectId; + } + catch (uno::Exception const&) + { + SAL_INFO("sfx.doc", "exception while getting Title or ObjectId"); + } if ( aFileName.isEmpty() ) aFileName = GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); |