From 08fad277a07bb3cd7873ccd4f4f64ec6dae21e9f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 11 May 2014 18:37:34 +0100 Subject: coverity#736102 Improper use of negative value Change-Id: I3f915ff949fa00357599e8cfc59c01c6eb04e9fd --- starmath/source/cursor.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit