summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-08-20 10:04:32 +0100
committerDavid Tardon <dtardon@redhat.com>2014-08-20 08:05:58 -0500
commit087c897d3da7a81b63fc79442127eb880d5c3155 (patch)
treefac31194979d645a470c8bff625bdddc556fbded
parent9a0d9d4f404eb49bbe23aa9b70a9ebd7bafdb7c0 (diff)
fix crash on loading ooo83574-1.doc
Change-Id: Ia959dde8bac2d663cf1a5bec0358ee89dcaf42ed (cherry picked from commit 17ccc09ec27bde00e5ed7a9fe6055a991992b0ed) Reviewed-on: https://gerrit.libreoffice.org/11038 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sw/source/core/crsr/annotationmark.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/crsr/annotationmark.cxx b/sw/source/core/crsr/annotationmark.cxx
index 95faaa52fe90..bee1ed934137 100644
--- a/sw/source/core/crsr/annotationmark.cxx
+++ b/sw/source/core/crsr/annotationmark.cxx
@@ -49,9 +49,11 @@ namespace sw { namespace mark
void AnnotationMark::InitDoc(SwDoc* const io_pDoc)
{
- SwTxtFld* pTxtFld =
- GetMarkEnd().nNode.GetNode().GetTxtNode()->GetFldTxtAttrAt(
- GetMarkEnd().nContent.GetIndex()-1, true );
+ SwTxtNode *pTxtNode = GetMarkEnd().nNode.GetNode().GetTxtNode();
+
+ SwTxtFld* pTxtFld = pTxtNode ?
+ pTxtNode->GetFldTxtAttrAt(
+ GetMarkEnd().nContent.GetIndex()-1, true ) : NULL;
OSL_ENSURE( pTxtFld != NULL, "<AnnotationMark::InitDoc(..)> - missing text attribute for annotation field!" );
if ( pTxtFld != NULL )
{