summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-11 18:37:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-11 21:05:54 +0100
commit08fad277a07bb3cd7873ccd4f4f64ec6dae21e9f (patch)
tree2734e3d93cd9ae6f30c3727ff08c96ae32b8cc84
parent9ca2e0abe7ed6c60682cadec836789dace169eb4 (diff)
coverity#736102 Improper use of negative value
Change-Id: I3f915ff949fa00357599e8cfc59c01c6eb04e9fd
-rw-r--r--starmath/source/cursor.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index f3eff790fd0c..7748db97edcf 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -809,7 +809,10 @@ bool SmCursor::InsertRow() {
//Find parent and offset in parent
SmStructureNode *pLineParent = pLine->GetParent();
int nParentIndex = pLineParent->IndexOfSubNode(pLine);
- OSL_ENSURE( nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+
+ assert(nParentIndex != -1); //pLine must be a subnode of pLineParent
+ if (nParentIndex == -1)
+ return false;
//Discover the context of this command
SmTableNode *pTable = NULL;