tdf#120703 PVS: nullptr dereference
V595 The 'pContact' pointer was utilized before it was verified against nullptr.
Check lines: 1254, 1256.
Change-Id: I5d3d28b3c8a70924f329fde9f020f42d9eb5e9a1
Reviewed-on: https://gerrit.libreoffice.org/71459
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index ec866b0..cad5209 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1253,10 +1253,10 @@
{
SwDrawContact *const pContact =
static_cast<SwDrawContact*>(GetUserCall( &rSdrObj ));
OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFormat()->Which(),
"InsertDrawLabel(): not a DrawFrameFormat" );
if (!pContact)
return nullptr;
OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFormat()->Which(),
"InsertDrawLabel(): not a DrawFrameFormat" );
SwDrawFrameFormat* pOldFormat = static_cast<SwDrawFrameFormat *>(pContact->GetFormat());
if (!pOldFormat)