diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2016-05-14 17:16:12 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-15 09:46:02 +0000 |
commit | d19b0fd3525aefd1c7d1b8b6564c77ffffede4e2 (patch) | |
tree | 1e7036d01201e36efca246d90496cce54e9ea3c2 | |
parent | 812233147c8b09b59eeb212663727a9063c7c9c6 (diff) |
tdf#99699 Do nullptr check BEFORE calling method
This fixes a segmentation fault accidently introduced with
commit a1fb4ac1991a8da2e527b64a0a01a88a8f2959e3.
Change-Id: I244e325934db22e1bffd03486cc5e84f539101f2
Reviewed-on: https://gerrit.libreoffice.org/24994
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit adc0ced6533449f33473db560b8ba27d4bd326f9)
Reviewed-on: https://gerrit.libreoffice.org/25001
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 9523b92d3767..ca7e8950a3bd 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -852,9 +852,10 @@ bool MSWordExportBase::HasRefToObject( sal_uInt16 nTyp, const OUString* pName, s SwIterator<SwFormatField, SwFieldType> aFormatFields( *pType ); for ( SwFormatField* pFormatField = aFormatFields.First(); pFormatField; pFormatField = aFormatFields.Next() ) { - const SwTextNode* pNd = pFormatField->GetTextField()->GetpTextNode(); + const SwTextNode* pNd; if ( pFormatField->GetTextField() && nTyp == pFormatField->GetField()->GetSubType() && - nullptr != pNd && pNd->GetNodes().IsDocNodes() ) + nullptr != ( pNd = pFormatField->GetTextField()->GetpTextNode() ) && + pNd->GetNodes().IsDocNodes() ) { const SwGetRefField& rRField = *static_cast< SwGetRefField* >( pFormatField->GetField() ); switch ( nTyp ) |