fix(editor): Prevent node renaming to restricted JS method names (#16270)

This commit is contained in:
oleg
2025-06-12 16:11:36 +02:00
committed by GitHub
parent 739ad853cd
commit ecfb6674ef
4 changed files with 188 additions and 2 deletions

View File

@@ -301,7 +301,16 @@ export function useCanvasOperations() {
// Rename the node and update the connections
const workflow = workflowsStore.getCurrentWorkflow(true);
workflow.renameNode(currentName, newName);
try {
workflow.renameNode(currentName, newName);
} catch (error) {
toast.showMessage({
type: 'error',
title: error.message,
message: error.description,
});
return;
}
if (trackHistory) {
historyStore.pushCommandToUndo(new RenameNodeCommand(currentName, newName, Date.now()));