Add back some checks

This commit is contained in:
Rachel Fenichel 2018-05-10 14:28:14 -07:00
parent f1603e5785
commit c5949a1bdd
2 changed files with 7 additions and 1 deletions

View file

@ -42,6 +42,9 @@ goog.require('goog.math.Coordinate');
* @constructor
*/
Blockly.Events.DragBlockOutside = function(block) {
if (!block) {
return; // Blank event to be populated by fromJson.
}
Blockly.Events.DragBlockOutside.superClass_.constructor.call(this, block);
this.recordUndo = false;
};
@ -83,6 +86,9 @@ Blockly.Events.DragBlockOutside.prototype.fromJson = function(json) {
* @constructor
*/
Blockly.Events.EndBlockDrag = function(block, isOutside) {
if (!block) {
return; // Blank event to be populated by fromJson.
}
Blockly.Events.EndBlockDrag.superClass_.constructor.call(this, block);
this.isOutside = isOutside;
// If drag ends outside the blocks workspace, send the block XML