diff options
authorJulian Kalinowski <>2020-03-31 12:45:31 +0200
committerAndras Timar <>2020-04-01 22:52:36 +0200
commitb62c2306f0db584e367dcbb6172a783179153008 (patch)
parent1f6d56897f19bee5af5883e6e8110e59894e9f1d (diff)
tdf#128662 Fix exception when accessing empty lock list
This fixes an Access Violation Exception when a WebDAV server says a resource is locked but does return an empty lockdiscovery element on WebDAV Propfind. Without this patch, the code only checks that a list exists, but it should also check if it contains elements before accessing it. Change-Id: I5f555a9b5805102242392b018ab5a8009c7a203c Reviewed-on: Tested-by: Mike Kaganski <> Reviewed-by: Mike Kaganski <> Reviewed-on: Tested-by: Xisco FaulĂ­ <> Reviewed-by: Xisco FaulĂ­ <> (cherry picked from commit 37cb8ac6abfc9bfd44aed1a51f6374ad1e23583a) Reviewed-on: Reviewed-by: Julian Kalinowski <> Reviewed-by: Michael Stahl <>
1 files changed, 1 insertions, 1 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 6bb27698673a..a7981fedb142 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1190,7 +1190,7 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand(bool bLoading, bool bN
uno::Sequence<css::ucb::Lock> aLocks;
// getting the property, send a PROPFIND to the server over the net
- if (aContentToLock.getPropertyValue("DAV:lockdiscovery") >>= aLocks)
+ if ((aContentToLock.getPropertyValue("DAV:lockdiscovery") >>= aLocks) && aLocks.hasElements())
// got at least a lock, show the owner of the first lock returned
css::ucb::Lock aLock = aLocks[0];