summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-09-03 11:00:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-09-03 14:52:46 +0200
commit3554e6d92b9045e6dd9881e294c3306dc08aeac9 (patch)
tree600d63fb9797b150bbefbffbd219a0efa4f2172b /starmath
parentd81ab079a01f1080506fd61194f5eb2642f3c692 (diff)
cid#1509261 Dereference after null check
Change-Id: I74cf3eed734bc09abdbca455d9a762b5aeb02481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139315 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathtype.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 66b4dfd60f84..9273a4498b61 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -3191,8 +3191,9 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
break;
case TOVERLINE: //If the next node is not text
//or text with more than one char
- if ((pIsText->GetToken().eType != TTEXT) ||
- (pIsText->GetText().getLength() > 1))
+ if (!pIsText ||
+ pIsText->GetToken().eType != TTEXT ||
+ pIsText->GetText().getLength() > 1)
nOldPending = StartTemplate(0x11);
break;
default:
@@ -3213,8 +3214,9 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
EndTemplate(nOldPending);
break;
case TOVERLINE:
- if ((pIsText->GetToken().eType != TTEXT) ||
- (pIsText->GetText().getLength() > 1))
+ if (!pIsText ||
+ pIsText->GetToken().eType != TTEXT ||
+ pIsText->GetText().getLength() > 1)
EndTemplate(nOldPending);
break;
default:
@@ -3261,8 +3263,9 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
pS->WriteUChar( 16 );
break;
case TOVERLINE:
- if ((pIsText->GetToken().eType == TTEXT) &&
- (pIsText->GetText().getLength() == 1))
+ if (pIsText &&
+ (pIsText->GetToken().eType == TTEXT &&
+ pIsText->GetText().getLength() == 1))
pS->WriteUChar( 17 );
break;
case TBREVE: