prevent crash if Col==-1
This commit is contained in:
parent
8143fb67c2
commit
80ad645b49
|
|
@ -460,6 +460,11 @@ SMPfindElt(SMPmatrix *Matrix, int Row, int Col, int CreateIfMissing)
|
|||
assert( IS_SPARSE( Matrix ) );
|
||||
Row = Matrix->ExtToIntRowMap[Row];
|
||||
Col = Matrix->ExtToIntColMap[Col];
|
||||
|
||||
if (Col == -1)
|
||||
/* No element available */
|
||||
return NULL;
|
||||
|
||||
Element = Matrix->FirstInCol[Col];
|
||||
Element = spcFindElementInCol(Matrix, &Element, Row, Col, CreateIfMissing);
|
||||
return Element;
|
||||
|
|
|
|||
Loading…
Reference in New Issue