addRow failing

I have a loop where I start with a grid with a single row, process, add row(now getRowsNum()==2 I test with doesRowExist(rowID)==true, access with grid.cells(grid.getRowsNum()-1,cInd).getValue() and it works. However on the next iteration with getRowsNum()==3, doesRowExist()==true but the exact same access command grid.cells(grid.getRowsNum()-1,cInd).getValue() fails with “c is null”. The fact that it works the first time and fails the second is totally impossible for me to understand. Please help.

An update.
I am able to confirm, with mind-numbing hours of testing, that if I add a row with grid.addRow(id,lines[0]) the row exists but I get that nightmare “c is null” when I try to access it with grid.cells(grid.getRowsNum()-1,cInd).getVaue(). Even more if I get the grid to report there are two rows, one with data and one blank that I added, if I try to access with grid.cells(0,cInt).getValue() or grid.cells(2,cInd).getValue() I get “c is null”. I only succeed if I access with grid.cells(1,cInd).getValue() or grid.cells(grid.getRowsNum()-1,cInd).getValue(), but ONLY the first time. On the second iteration when grid.getRowsNum()==3 and I access with grid.cells(grid.getRowsNum()-1,cInd).getValue() I get “c is null”. Ideas? Please.

(lines[0] is just a “row” in a two-dimensional array with the proper number of columns. Same failure even if I create a single dimension array.)

You should try to use cells2() method instead of cells(). … ect_cells2