diff --git a/blocks/loops.js b/blocks/loops.js
index <HASH>..<HASH> 100644
--- a/blocks/loops.js
+++ b/blocks/loops.js
@@ -257,7 +257,7 @@ Blockly.Blocks['controls_flow_statements'] = {
    * @this Blockly.Block
    */
   onchange: function(e) {
-    if (this.workspace.isDragging()) {
+    if (!this.workspace.isDragging || this.workspace.isDragging()) {
       return;  // Don't change state at the start of a drag.
     }
     var legal = false;
diff --git a/blocks/procedures.js b/blocks/procedures.js
index <HASH>..<HASH> 100644
--- a/blocks/procedures.js
+++ b/blocks/procedures.js
@@ -843,7 +843,7 @@ Blockly.Blocks['procedures_ifreturn'] = {
    * @this Blockly.Block
    */
   onchange: function(e) {
-    if (this.workspace.isDragging()) {
+    if (!this.workspace.isDragging || this.workspace.isDragging()) {
       return;  // Don't change state at the start of a drag.
     }
     var legal = false;
Stop some blocks from throwing errors in headless workspaces.