From 45e24c2b98d97f77cef12eac6b3c5574bbe70c78 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Thu, 28 Mar 2019 15:14:44 -0700 Subject: [PATCH] No need to check non-null before nullifying --- core/workspace_svg.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 4ec9b0e44..0a68fe98d 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -594,12 +594,9 @@ Blockly.WorkspaceSvg.prototype.dispose = function() { this.grid_ = null; } - if (this.toolboxCategoryCallbacks_) { - this.toolboxCategoryCallbacks_ = null; - } - if (this.flyoutButtonCallbacks_) { - this.flyoutButtonCallbacks_ = null; - } + this.toolboxCategoryCallbacks_ = null; + this.flyoutButtonCallbacks_ = null; + if (!this.options.parentWorkspace) { // Top-most workspace. Dispose of the div that the // SVG is injected into (i.e. injectionDiv).