cid#1458160 Dereference before null check

since...

commit 6e2ed4ea934851f82611c3352b9551046fda89d0
Date:   Mon Jan 20 11:55:02 2020 +0300

    sw: set unique name for fontwork object and style on insertion

Change-Id: I0030425c77bba9a8fe720002114c2b9076c93c4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88078
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 51f2f7f..ae5ed82 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -935,8 +935,8 @@
    }
    // insert drawing object into the document creating a new <SwDrawFrameFormat> instance
    SwDrawFrameFormat* pFormat = GetDoc()->getIDocumentContentOperations().InsertDrawObj( aPam, rDrawObj, rFlyAttrSet );
    pFormat->SetName(GetDoc()->GetUniqueShapeName());
    rDrawObj.SetName(pFormat->GetName());
    OUString sShapeName = GetDoc()->GetUniqueShapeName();
    rDrawObj.SetName(sShapeName);

    // move object to visible layer
    SwContact* pContact = static_cast<SwContact*>(rDrawObj.GetUserCall());
@@ -945,8 +945,9 @@
        pContact->MoveObjToVisibleLayer( &rDrawObj );
    }

    if ( pFormat )
    if (pFormat)
    {
        pFormat->SetName(sShapeName);
        // select drawing object
        Imp()->GetDrawView()->MarkObj( &rDrawObj, Imp()->GetPageView() );
    }