Crash in UDataTable::HandleDataTableChanged caused by calling UDataTable::RemoveRow

Hello,

after a recent engine upgrade from 5.4 to 5.6 we experience crashes in UDataTable::HandleDataTableChanged line 240 when removing a DataTable row by name using the UDataTable::RemoveRow function. It is also possible other DataTable functions that call the RemoveRow function can cause the same issue.

The reason seems to be that RemoveRow creates an FScopedDataTableChange which is now taking the changed RowName as a Parameter. RowName in case of deletion is the name of the deleted row.

In ~FScopedDataTableChange HandleDataTableChanged is called with the RowName of the deleted row. However HandleDataTableChanged assumes it will only ever be called with valid RowNames. Obviously, after calling RemoveRow the row it is trying to access no longer exist.

For anyone else stumbling over this issue, there is a workaround for in Editor use:

Instead of using DataTable functions to modify data table rows in editor you can the FDataTableEditorUtils functions.

Greetings,

Ann

Steps to Reproduce

  1. Create a DataTable.
  2. Add any row.
  3. Create an AssetActionUtility that can remove a row from a DataTable. E.g. by calling DataTableFunctionLibrary::RemoveDataTableRow. Whether in Blueprint or Cpp does not matter. It is important DataTable::RemoveRow is called eventually.
  4. Try Removing the row from the DataTable via RowName and the AssetActionUtility.
  5. Observe crash in UDataTable::HandleDataTableChanged line 240.

Hello,

The problem was addressed with CL43793740. This fix did not make it to the 5.6.1 hotfix that should soon release. I’m afraid that you will have to use the work around until version 5.7 release since you are using the Launcher build.

Regards,

Martin