coverity#736099 Improper use of negative value

Change-Id: I065a8074fcafba123898c70eded464aa108e2e9e
This commit is contained in:
Caolán McNamara 2014-03-20 16:47:49 +00:00
parent 84c4838feb
commit 46c95fa740

View file

@ -302,6 +302,11 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){
SmStructureNode* pLineParent = pLine->GetParent();
int nParentIndex = pLineParent->IndexOfSubNode(pLine);
OSL_ENSURE(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
if (nParentIndex == -1)
{
delete pNewNodes;
return;
}
//Convert line to list
SmNodeList* pLineList = NodeToList(pLine);