Table component error after deleting dataset row

I have a perspective table component that shows this message when i try to remove the last row from the dataset:
image

This is the code from my delete row button.

	data = self.getSibling("Table").props.data
	row = self.getSibling("Table").props.selection.selectedRow
	
	self.getSibling("Table").props.selection.selectedColumn = None
	self.getSibling("Table").props.selection.selectedRow = None
	data = system.dataset.deleteRow(data, row)
	self.getSibling("Table").props.data = data

I am hoping someone can point me in the right direction, i've tried everything i can think of and nothing has resolved the issue. Thank you in advance.

Is data actually a dataset of is it an object?
You could put type(data) on line 2 to check. Monitor the result at the bottom of the binding window.

I believe so, says it is BasicStreamingDataset. The remove code works fine for all but the last row.

I almost don't want to tell you what it was.

Idiot that I am, I was not noticing that I had enabled single click edit and just so happened to have clicked into an editable cell every time i selected the last row. Thanks for the help!