mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(editor): Prevent node renaming to restricted JS method names (#16270)
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user