summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-06-06 16:20:45 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-06-06 19:12:07 +0200
commit6fc8a48691bfa011c8b09e560196c5d3b98fdb76 (patch)
tree7adae329ab660a166edb0663dc90084a3eae9cb1 /sfx2
parente5fe8434110c1299527a0d03bf450e1b6d08ca57 (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>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f43213b67e97..d9379866deaa 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2426,11 +2426,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 );