summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-05-28 17:15:08 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-31 13:43:56 +0200
commita8889286995de5e51cd01e83101832f78e978fd9 (patch)
treece0cea3ca6d2b3ffc897f22672dd34a30c49faf2
parentac662268e2a90e73651775090a74370973f3c57f (diff)
Related: tdf#106950 sw: fix crash on opening this file
Not every paragraph supports the container::XEnumerationAccess interface. Change-Id: I0690f2e631f733b8f478a7df30d2918400eccf2f Reviewed-on: https://gerrit.libreoffice.org/38111 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit e01c6a3ba7c0e6a089769187ee1ad241aa862280) Reviewed-on: https://gerrit.libreoffice.org/38266
-rw-r--r--sw/source/core/edit/edfcol.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 4ffbd1263864..e044ef503965 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -122,6 +122,9 @@ uno::Reference<drawing::XShape> lcl_getWatermark(const uno::Reference<text::XTex
while (xParagraphs->hasMoreElements())
{
uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraphs->nextElement(), uno::UNO_QUERY);
+ if (!xTextPortionEnumerationAccess.is())
+ continue;
+
uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
while (xTextPortions->hasMoreElements())
{