fix: prevent crash when reordering query params with empty name (#6938)

* fix: prevent crash when reordering query params with empty name

* fix: prevent crash when reordering rows with empty key field
This commit is contained in:
gopu-bruno
2026-01-29 13:56:40 +05:30
committed by GitHub
parent 579cda1d1a
commit 4f327b7b77

View File

@@ -162,6 +162,11 @@ const EditableTable = ({
const reorderableRows = showAddRow ? rowsWithEmpty.slice(0, -1) : rowsWithEmpty;
const updatedOrder = [...reorderableRows];
const [movedRow] = updatedOrder.splice(fromIndex, 1);
if (!movedRow) {
setDragStart(null);
setHoveredRow(null);
return;
}
updatedOrder.splice(toIndex, 0, movedRow);
onReorder({ updateReorderedItem: updatedOrder.map((row) => row.uid) });
}