coverity#1397207 Dereference before null check
Change-Id: I2578d59e98a2b1b040d9284b0ad0f68fd331d0df
(cherry picked from commit 7a9d5485a815af26c63790e3165477c68e164117)
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ded98a2..a62d9a4 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -415,9 +415,9 @@ const SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( const SdrObject* _pSdr
const SwAnchoredObject* pRetAnchoredObj = nullptr;
if ( _pSdrObj && dynamic_cast<const SwVirtFlyDrawObj*>( _pSdrObj) != nullptr )
if (const SwVirtFlyDrawObj* pFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>(_pSdrObj))
{
pRetAnchoredObj = static_cast<const SwVirtFlyDrawObj*>(_pSdrObj)->GetFlyFrame();
pRetAnchoredObj = pFlyDrawObj->GetFlyFrame();
}
return pRetAnchoredObj;