List 'beforeAdd' event error after upgrading to v9.2.5

I upgraded the Suite from version 9.0.2 to 9.2.5. Since then, I encounter an error in the following scenario.

When a grid item is dropped onto a list, I use the list’s data event beforeAdd to validate the item.
If the validation passes, the item is added; otherwise, it is rejected.

This workflow worked flawlessly before the version upgrade. However, since upgrading, the following error message occurs whenever false is returned:

Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
at http://example.com/assets/dhtmlx/suite.js:28279:31
at Array.forEach ()
at DragManager._move (http://example.com/assets/dhtmlx/suite.js:28278:39)
at DragManager._onDrop (http://example.com/assets/dhtmlx/suite.js:27953:22)
at DragManager._onMouseUp (http://example.com/assets/dhtmlx/suite.js:27825:23)

Here is a minimal example:

const list = new dhx.List(null, {
    dragMode: 'target',
    ...config
});

list.data.events.on('beforeAdd', (item) => {
    ...some validation tests...
    if ( ...valid ) {
        return true;
    } else {
        return false; // Throws Error
    }
});

Hello @Czeslaw,

Thank you for the detailed description of the issue and the provided code.

First point:

The correct approach in your case is to use validation before the end of dnd operation, in the beforeDrop event, like follows:

listTarget.events.on("beforeDrop", function(data, events) {
    console.log(listSource.data.getItem(data.start))
    return false;
});

Here is an example:
https://snippet.dhtmlx.com/pms5p6m3

So the issue will be fixed.

Second point:

Returning false from the beforeAdd event shouldn’t throw errors, and the dev team will fix it in future updates.

Kind regards,