From 06f6c22a27dffa6eb6eba0f7e9ec115cc45edf6a Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 3 Apr 2020 14:36:19 -0700 Subject: [PATCH] Fix field colour in headless (#3795) --- core/field_colour.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/field_colour.js b/core/field_colour.js index 6cf82d089..562bdaeec 100644 --- a/core/field_colour.js +++ b/core/field_colour.js @@ -220,7 +220,7 @@ Blockly.FieldColour.prototype.doValueUpdate_ = function(newValue) { this.value_ = newValue; if (this.borderRect_) { this.borderRect_.style.fill = newValue; - } else if (this.sourceBlock_) { + } else if (this.sourceBlock_ && this.sourceBlock_.rendered) { this.sourceBlock_.pathObject.svgPath.setAttribute('fill', newValue); this.sourceBlock_.pathObject.svgPath.setAttribute('stroke', '#fff'); }