From bca5fd36d3166eaca2b635b5b6ba897d51cc578c Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 3 Jan 2019 13:20:28 -0800 Subject: [PATCH] Fix failing test --- core/blockly.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/blockly.js b/core/blockly.js index 86d364eec..5cd4192c4 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -687,19 +687,19 @@ Blockly.checkBlockColourConstant_ = function( */ Blockly.setStyle = function(style) { this.style_ = style; - var workspace = Blockly.getMainWorkspace(); + var ws = Blockly.getMainWorkspace(); - this.updateBlockStyles_(workspace.getAllBlocks()); + this.updateBlockStyles_(ws.getAllBlocks()); - if (!workspace.toolbox_) { - this.updateBlockStyles_(workspace.flyout_.workspace_.getAllBlocks()); + if (!ws.toolbox_ && ws.flyout_ && ws.flyout_.workspace_) { + this.updateBlockStyles_(ws.flyout_.workspace_.getAllBlocks()); } else { - workspace.refreshToolboxSelection(); + ws.refreshToolboxSelection(); } var event = new Blockly.Events.Ui(null, 'styleChanged'); - event.workspaceId = workspace.id; + event.workspaceId = ws.id; Blockly.Events.fire(event); };