diff options
-rw-r--r-- | writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx index 3d3a6a0b268e..3398c216093f 100644 --- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx @@ -319,12 +319,20 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc // simple string concatination here to handle that. uno::Reference<uri::XUriReference> xPart = xFac->parse(sMyTarget); uno::Reference<uri::XUriReference> xAbs = xFac->makeAbsolute(xBase, xPart, true, uri::RelativeUriExcessParentSegments_RETAIN); - rDocumentTarget = xAbs->getPath(); - // path will start with the fragment separator. need to - // remove that - rDocumentTarget = rDocumentTarget.copy( 1 ); - if(sStreamType == sEmbeddingsType) - embeddingsTarget = rDocumentTarget; + if (!xAbs) + { + //it was invalid gibberish + bFound = false; + } + else + { + rDocumentTarget = xAbs->getPath(); + // path will start with the fragment separator. need to + // remove that + rDocumentTarget = rDocumentTarget.copy( 1 ); + if(sStreamType == sEmbeddingsType) + embeddingsTarget = rDocumentTarget; + } } break; |