cid#1500524 Dereference after null check

Change-Id: Ic76f1b4992f51bdfe10406734ce00135607db357
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131001
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2022-03-04 15:31:03 +00:00
parent 5541b7b1dd
commit f3226c540d

View File

@@ -1728,7 +1728,7 @@ Reference< XShape > const & Shape::createAndInsert(
}
// in some cases, we don't have any text body.
if( getTextBody() && ( !bDoNotInsertEmptyTextBody || !mpTextBody->isEmpty() ) )
if( mpTextBody && ( !bDoNotInsertEmptyTextBody || !mpTextBody->isEmpty() ) )
{
Reference < XText > xText( mxShape, UNO_QUERY );
if ( xText.is() ) // not every shape is supporting an XText interface (e.g. GroupShape)