summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2016-05-14 17:16:12 +0200
committerJulien Nabet <serval2412@yahoo.fr>2016-05-14 17:31:26 +0000
commitadc0ced6533449f33473db560b8ba27d4bd326f9 (patch)
tree343ff67c403d4d5bb87a112b9399919a3ce0a188
parente4127e4cd7bd27b9a616e1550cc9845096a66114 (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>
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 6c4cab4577c2..5cd5297ca533 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 )