From 0b8d81e8b3da081ebdb1ae7fed7b20a51322f951 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 3 Aug 2015 20:25:49 +0100 Subject: coverity#1314998 Dereference null return value Change-Id: I1f36c486b404d189f2f39a525ec3fd2e1710e7af --- sw/source/core/undo/rolbck.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 2d2bced5d62b..e98414af5172 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -1442,13 +1442,14 @@ void SwRegHistory::_MakeSetWhichIds() if( pSet && pSet->Count() ) { SfxItemIter aIter( *pSet ); - sal_uInt16 nW = aIter.FirstItem()->Which(); - while( true ) + const SfxPoolItem* pItem = aIter.FirstItem(); + while(pItem) { + sal_uInt16 nW = pItem->Which(); m_WhichIdSet.insert( nW ); if( aIter.IsAtEnd() ) break; - nW = aIter.NextItem()->Which(); + pItem = aIter.NextItem(); } } } -- cgit v1.2.3