Browse Source

[frontend] prevent js workflow error when moving args

Björn Alm 2 years ago
parent
commit
39771cbc24
1 changed files with 7 additions and 5 deletions
  1. 7 5
      apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

+ 7 - 5
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -671,11 +671,13 @@ ${ utils.submit_popup_event() }
         showAddActionDemiModal(widget);
         showAddActionDemiModal(widget);
       });
       });
     } else {
     } else {
-      if (window.workflowEditorViewModel.currentlyDraggedOp() == "move"){
-        window.workflowEditorViewModel.workflow.moveNode(widget);
-      } else { // Copy
-        var _sourceNode = window.workflowEditorViewModel.workflow.getNodeById(window.workflowEditorViewModel.currentlyDraggedWidget().id());
-        window.workflowEditorViewModel.workflow.newNode(widget, window.workflowEditorViewModel.workflow.addNode, _sourceNode);
+      if (widget) {
+        if (window.workflowEditorViewModel.currentlyDraggedOp() == "move"){
+          window.workflowEditorViewModel.workflow.moveNode(widget);
+        } else { // Copy
+          var _sourceNode = window.workflowEditorViewModel.workflow.getNodeById(window.workflowEditorViewModel.currentlyDraggedWidget().id());
+          window.workflowEditorViewModel.workflow.newNode(widget, window.workflowEditorViewModel.workflow.addNode, _sourceNode);
+        }
       }
       }
       window.setTimeout(renderChangeables, 0);
       window.setTimeout(renderChangeables, 0);
     }
     }