Don't compute (useless) location of trashcan while workspace is being built.

Theoretical performance bump, fixes crash in Opera 12.
This commit is contained in:
Neil Fraser
2018-03-15 17:10:38 -07:00
committed by Neil Fraser
parent b1e4648c3c
commit 554e644017

View File

@@ -1009,7 +1009,7 @@ Blockly.WorkspaceSvg.prototype.createVariable = function(name, opt_type, opt_id)
* Make a list of all the delete areas for this workspace.
*/
Blockly.WorkspaceSvg.prototype.recordDeleteAreas = function() {
if (this.trashcan) {
if (this.trashcan && this.svgGroup_.parentNode) {
this.deleteAreaTrash_ = this.trashcan.getClientRect();
} else {
this.deleteAreaTrash_ = null;