Index: tol/btol/vmatrix_type/vmat.cpp
===================================================================
--- tol/btol/vmatrix_type/vmat.cpp	(revision 9180d5263e00f27b3295d756465eb1612310b030)
+++ tol/btol/vmatrix_type/vmat.cpp	(revision fb786f4a1cad865e63cf036d048503e2fb1349bd)
@@ -1519,5 +1519,11 @@
         assert((*i>=0)&&(*i<r));
         *rIdx = (int)cx[*i]-1; 
-        assert((*rIdx>=0)&&(*rIdx<nrow));
+        if((*rIdx<0)||(*rIdx>=nrow))
+        {
+          err_cannot_create(fName, 
+            BText("Invalid row index ")+((*rIdx)+1)+" out of range [1,"+nrow+"]");
+          result = -7;
+          break;
+        }
       }
       nnz   += a_[n]->s_.chlmRtriplet_->nnz;
