summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-26 10:06:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-26 12:14:37 +0000
commitf191139bcec033102ca209c43b4f542abf100f70 (patch)
tree860c5ca44154f23558de12ac7b1389cec089a057 /starmath
parent7be08f650d0d78e2f812b4161c579e84f7e86e1b (diff)
coverity#1266461 Improper use of negative value
Change-Id: I4f78617129de21f7088d6f0d8b781674faa6b45a
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/cursor.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index daf16dd454e0..9a45577ce77d 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -676,6 +676,8 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) {
SmStructureNode *pLineParent = pLine->GetParent();
int nParentIndex = pLineParent->IndexOfSubNode(pLine);
OSL_ENSURE( nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+ if (nParentIndex < 0)
+ return;
//Convert line to list
SmNodeList *pLineList = NodeToList(pLine);