Grid multiple selection

    var objCol = obj.getColumn("goodsnm");
    
	if(obj.selection.getCells().length<1){
		obj.selection.removeCell();
		obj.data.forEach(function(row){
				obj.selection.setCell(row.id, objCol, true, false);
		});
		obj.paint();
	}

hello
When selecting all of the grids, the following error appears. Please help.

error : core.ts:191 Uncaught TypeError: Cannot read properties of null (reading ‘0’)
at compare (core.ts:191:18)
at Object.compare (core.ts:171:10)
at Selection.ts:336:9
at Array.some ()
at Selection._findIndex (Selection.ts:329:23)
at Selection.setCell (Selection.ts:136:28)
at mmp.js:3241:20

Hello.

Unfortunately I was not able to reconstruct your issue locally.
The following snippet works well with your provided code:
https://snippet.dhtmlx.com/hypvk1fm
If the problem still occurs for you please, provide a complete demo, snippet or a demo link, where the problem can be reconstructed locally.