This is a fix for T81589. The datastack_drop_poll function did not include a check if the drag->type is WM_DRAG_ID. This resulted in the pointer drag->poin being interpreted as pointer to StackDropData even if it didn't have the correct type. The crash was caused by calling datastack_drop_init because the incorrect data was attempted to be used as pointer and dereferenced with drop_data->drag_tselem->type.
Adding the required type check appears to fix the issue.