diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-09-01 11:41:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-09-01 15:01:49 +0200 |
commit | c097c2ff102e8033afd26e22b7ea092ae82e27b0 (patch) | |
tree | 9879f5a6dbb6b23d7bcdba3a5a3a98ed90f1e868 /starmath | |
parent | f5ce2df24a91796d6b8c732ad1a8ab3c5f736cde (diff) |
cid#1509261 Dereference after null check
Change-Id: Ib6dd69e4610ee6df76cde8446677e0f68bed3e0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139157
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/mathtype.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 518f29fc5b40..66b4dfd60f84 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -3204,19 +3204,22 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) if (pIsText) HandleNodes(pIsText,nLevel+1); - switch (pTemp->GetToken().eType) + if (pTemp) { - case TWIDEVEC: - case TUNDERLINE: - EndTemplate(nOldPending); - break; - case TOVERLINE: - if ((pIsText->GetToken().eType != TTEXT) || - (pIsText->GetText().getLength() > 1)) + switch (pTemp->GetToken().eType) + { + case TWIDEVEC: + case TUNDERLINE: EndTemplate(nOldPending); - break; - default: - break; + break; + case TOVERLINE: + if ((pIsText->GetToken().eType != TTEXT) || + (pIsText->GetText().getLength() > 1)) + EndTemplate(nOldPending); + break; + default: + break; + } } //if there was no suitable place to put the attribute, |